io_uring/net: handle -EINPROGRESS correct for IORING_OP_CONNECT
authorJens Axboe <axboe@kernel.dk>
Wed, 5 Oct 2022 02:29:48 +0000 (20:29 -0600)
committerJens Axboe <axboe@kernel.dk>
Fri, 7 Oct 2022 18:25:31 +0000 (12:25 -0600)
commitbe4af92cf8a799a5f3c387068893ead0ba0fbb97
treed7fbd9b6e44c347fc3c873c92aaca1ae854ab65d
parent99b60457f51d584053a63bbccf54e036ae35df2a
io_uring/net: handle -EINPROGRESS correct for IORING_OP_CONNECT

We treat EINPROGRESS like EAGAIN, but if we're retrying post getting
EINPROGRESS, then we just need to check the socket for errors and
terminate the request.

This was exposed on a bluetooth connection request which ends up
taking a while and hitting EINPROGRESS, and yields a CQE result of
-EBADFD because we're retrying a connect on a socket that is now
connected.

Cc: stable@vger.kernel.org
Fixes: 87f80d623c6c ("io_uring: handle connect -EINPROGRESS like -EAGAIN")
Link: https://github.com/axboe/liburing/issues/671
Reported-by: Aidan Sun <aidansun05@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/net.c