summaryrefslogtreecommitdiff
path: root/io_uring/net.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2024-04-12 12:39:54 -0600
committerJens Axboe <axboe@kernel.dk>2024-04-15 08:10:25 -0600
commit3ba8345aec886a3a01331e944a6a8568bf94bd10 (patch)
treea84b72835bae34d47326999f917fa85e1d46eed0 /io_uring/net.c
parent790b68b32a678b65b161861f83b2b782b6b9246b (diff)
io_uring/net: always set kmsg->msg.msg_control_user before issue
We currently set this separately for async/sync entry, but let's just move it to a generic pre-issue spot and eliminate the difference between the two. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/net.c')
-rw-r--r--io_uring/net.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/io_uring/net.c b/io_uring/net.c
index d095d3e48fcd..b08c0ae5951a 100644
--- a/io_uring/net.c
+++ b/io_uring/net.c
@@ -391,7 +391,6 @@ int io_sendmsg(struct io_kiocb *req, unsigned int issue_flags)
if (req_has_async_data(req)) {
kmsg = req->async_data;
- kmsg->msg.msg_control_user = sr->msg_control;
} else {
kmsg = io_msg_alloc_async(req, issue_flags);
if (unlikely(!kmsg))
@@ -411,6 +410,8 @@ int io_sendmsg(struct io_kiocb *req, unsigned int issue_flags)
if (flags & MSG_WAITALL)
min_ret = iov_iter_count(&kmsg->msg.msg_iter);
+ kmsg->msg.msg_control_user = sr->msg_control;
+
ret = __sys_sendmsg_sock(sock, &kmsg->msg, flags);
if (ret < min_ret) {
@@ -1271,7 +1272,6 @@ int io_sendmsg_zc(struct io_kiocb *req, unsigned int issue_flags)
if (req_has_async_data(req)) {
kmsg = req->async_data;
- kmsg->msg.msg_control_user = sr->msg_control;
} else {
kmsg = io_msg_alloc_async(req, issue_flags);
if (unlikely(!kmsg))
@@ -1291,6 +1291,7 @@ int io_sendmsg_zc(struct io_kiocb *req, unsigned int issue_flags)
if (flags & MSG_WAITALL)
min_ret = iov_iter_count(&kmsg->msg.msg_iter);
+ kmsg->msg.msg_control_user = sr->msg_control;
kmsg->msg.msg_ubuf = &io_notif_to_data(sr->notif)->uarg;
kmsg->msg.sg_from_iter = io_sg_from_iter_iovec;
ret = __sys_sendmsg_sock(sock, &kmsg->msg, flags);