Skip to contentSkip to conversation

io_uring: wire up allocated direct descriptors for socket

PATCH In review Jens Axboe 2 participants 2 messages May 26, 2022 – May 27, 2022

Subsystems (2)
lore
Share & tools
lore

Jens Axboe

author maintainer
#0 lore raw

PATCH 1/1 io_uring: wire up allocated direct descriptors for socket

The socket support was merged in an earlier branch that didn't yet have support for allocating direct descriptors, hence only open and accept got support for that.

Do the one-liner to enable it now, so we have consistent support for any request that can instantiate a file/direct descriptor.

---

fs/io_uring.c +2 -2
index ccb47d87a65a..d50bbf8de4fb 100644
@@ -6676,8 +6676,8 @@ static int io_socket(struct io_kiocb *req, unsigned int issue_flags)
 		fd_install(fd, file);
 		ret = fd;
 	} else {
-		ret = io_install_fixed_file(req, file, issue_flags,
-					    sock->file_slot - 1);
+		ret = io_fixed_fd_install(req, issue_flags, file,
+					    sock->file_slot);
 	}
 	__io_req_complete(req, issue_flags, ret, 0);
 	return 0;
Signature · 1 line
Jens Axboe
Reviewed-by on v1 1/1
#1 lore raw
Quoted 17 lines · Jens Axboe

The socket support was merged in an earlier branch that didn't yet have support for allocating direct descriptors, hence only open and accept got support for that.

Do the one-liner to enable it now, so we have consistent support for any request that can instantiate a file/direct descriptor.

---

fs/io_uring.c +0 -0
index ccb47d87a65a..d50bbf8de4fb 100644

fs/io_uring.c static int io_socket(struct io_kiocb *req, unsigned int issue_flags) · line 6683

Quoted 10 lines
fs/io_uring.c +2 -2
@@ -6676,8 +6676,8 @@ static int io_socket(struct io_kiocb *req, unsigned int issue_flags)
  		fd_install(fd, file);
  		ret = fd;
  	} else {
-		ret = io_install_fixed_file(req, file, issue_flags,
-					    sock->file_slot - 1);
+		ret = io_fixed_fd_install(req, issue_flags, file,
+					    sock->file_slot);
  	}
  	__io_req_complete(req, issue_flags, ret, 0);
  	return 0;