summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2024-08-09 09:32:10 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2024-08-09 09:32:10 -0700
commit8828729c4435b85844a3b6da19cc7c148c59ec43 (patch)
tree4a64f759d11dbef4fbc4c3f7d59ced0493035520
parent377773dd6be500d17b94de08271ff9ed643554f1 (diff)
parent8fe8ac24adcd76b12edbfdefa078567bfff117d4 (diff)
downloadlinux-8828729c4435b85844a3b6da19cc7c148c59ec43.tar.gz
linux-8828729c4435b85844a3b6da19cc7c148c59ec43.tar.bz2
linux-8828729c4435b85844a3b6da19cc7c148c59ec43.zip
Merge tag 'io_uring-6.11-20240809' of git://git.kernel.dk/linux
Pull io_uring fixes from Jens Axboe: "Nothing major in here, just two fixes for ensuring that bundle recv/send requests always get marked for cleanups, and a single fix to ensure that sends with provided buffers only pick a single buffer unless the bundle option has been enabled" * tag 'io_uring-6.11-20240809' of git://git.kernel.dk/linux: io_uring/net: don't pick multiple buffers for non-bundle send io_uring/net: ensure expanded bundle send gets marked for cleanup io_uring/net: ensure expanded bundle recv gets marked for cleanup
-rw-r--r--io_uring/net.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/io_uring/net.c b/io_uring/net.c
index 594490a1389b..d08abcca89cc 100644
--- a/io_uring/net.c
+++ b/io_uring/net.c
@@ -601,17 +601,18 @@ retry_bundle:
.iovs = &kmsg->fast_iov,
.max_len = INT_MAX,
.nr_iovs = 1,
- .mode = KBUF_MODE_EXPAND,
};
if (kmsg->free_iov) {
arg.nr_iovs = kmsg->free_iov_nr;
arg.iovs = kmsg->free_iov;
- arg.mode |= KBUF_MODE_FREE;
+ arg.mode = KBUF_MODE_FREE;
}
if (!(sr->flags & IORING_RECVSEND_BUNDLE))
arg.nr_iovs = 1;
+ else
+ arg.mode |= KBUF_MODE_EXPAND;
ret = io_buffers_select(req, &arg, issue_flags);
if (unlikely(ret < 0))
@@ -623,6 +624,7 @@ retry_bundle:
if (arg.iovs != &kmsg->fast_iov && arg.iovs != kmsg->free_iov) {
kmsg->free_iov_nr = ret;
kmsg->free_iov = arg.iovs;
+ req->flags |= REQ_F_NEED_CLEANUP;
}
}
@@ -1094,6 +1096,7 @@ static int io_recv_buf_select(struct io_kiocb *req, struct io_async_msghdr *kmsg
if (arg.iovs != &kmsg->fast_iov && arg.iovs != kmsg->free_iov) {
kmsg->free_iov_nr = ret;
kmsg->free_iov = arg.iovs;
+ req->flags |= REQ_F_NEED_CLEANUP;
}
} else {
void __user *buf;