From 11360117c32c2a2762b549b846ce7c7fb4f964ea Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Tue, 3 Dec 2019 11:23:54 -0700 Subject: [PATCH 1070/2944] io_uring: handle connect -EINPROGRESS like -EAGAIN to #26323578 commit 87f80d623c6c93c721b2aaead8a45e848bc8ffbf upstream. 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 Signed-off-by: Joseph Qi Acked-by: Xiaoguang Wang --- fs/io_uring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/io_uring.c b/fs/io_uring.c index 54e5002..a459c12 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -2238,7 +2238,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; -- 1.8.3.1