]> git.baikalelectronics.ru Git - kernel.git/commit
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>
Wed, 12 Oct 2022 22:30:56 +0000 (16:30 -0600)
commit2bb9166f54e842d1b286537be85b44d1601a5051
tree611bbd549bd257bcaabec648722bc1e06fbc8720
parentc4121a39e6085298e3151ab3a3ea226389d9541c
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: abe25e5e024a ("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