Skip to content

Commit

Permalink
io_uring: handle connect -EINPROGRESS like -EAGAIN
Browse files Browse the repository at this point in the history
Right now we return it to userspace, which means the application has
to poll for the socket to be writeable. Let's just treat it like
-EAGAIN and have io_uring handle it internally, this makes it much
easier to use.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Jens Axboe committed Dec 3, 2019
1 parent 6c6b354 commit 87f80d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/io_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -2242,7 +2242,7 @@ static int io_connect(struct io_kiocb *req, const struct io_uring_sqe *sqe,

ret = __sys_connect_file(req->file, &io->connect.address, addr_len,
file_flags);
if (ret == -EAGAIN && force_nonblock) {
if ((ret == -EAGAIN || ret == -EINPROGRESS) && force_nonblock) {
io = kmalloc(sizeof(*io), GFP_KERNEL);
if (!io) {
ret = -ENOMEM;
Expand Down

0 comments on commit 87f80d6

Please sign in to comment.