io_uring/poll: fix POLLERR handling io_uring-6.16 io_uring-6.16-20250718
authorPavel Begunkov <asml.silence@gmail.com>
Wed, 16 Jul 2025 16:20:17 +0000 (17:20 +0100)
committerJens Axboe <axboe@kernel.dk>
Wed, 16 Jul 2025 16:28:28 +0000 (10:28 -0600)
commitc7cafd5b81cc07fb402e3068d134c21e60ea688c
treeeae01611b66897e70652f8e8a53d280df1c3a4c9
parent08ca1409c4fa37ec93de08b9963390ed68a5ae8c
io_uring/poll: fix POLLERR handling

8c8492ca64e7 ("io_uring/net: don't retry connect operation on EPOLLERR")
is a little dirty hack that
1) wrongfully assumes that POLLERR equals to a failed request, which
breaks all POLLERR users, e.g. all error queue recv interfaces.
2) deviates the connection request behaviour from connect(2), and
3) racy and solved at a wrong level.

Nothing can be done with 2) now, and 3) is beyond the scope of the
patch. At least solve 1) by moving the hack out of generic poll handling
into io_connect().

Cc: stable@vger.kernel.org
Fixes: 8c8492ca64e79 ("io_uring/net: don't retry connect operation on EPOLLERR")
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/3dc89036388d602ebd84c28e5042e457bdfc952b.1752682444.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/net.c
io_uring/poll.c