Commit 87f80d62 authored by Jens Axboe's avatar Jens Axboe
Browse files

io_uring: handle connect -EINPROGRESS like -EAGAIN



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: default avatarJens Axboe <axboe@kernel.dk>
parent 6c6b3549
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -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,
	ret = __sys_connect_file(req->file, &io->connect.address, addr_len,
					file_flags);
					file_flags);
	if (ret == -EAGAIN && force_nonblock) {
	if ((ret == -EAGAIN || ret == -EINPROGRESS) && force_nonblock) {
		io = kmalloc(sizeof(*io), GFP_KERNEL);
		io = kmalloc(sizeof(*io), GFP_KERNEL);
		if (!io) {
		if (!io) {
			ret = -ENOMEM;
			ret = -ENOMEM;