diff options
| author | Jens Axboe <axboe@kernel.dk> | 2024-08-07 15:09:33 -0600 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-08-14 15:34:26 +0200 |
| commit | 1ae918806c220ffe04737c6368261699d5202acb (patch) | |
| tree | f65adff70321256cc7e7f55ae53e5e0a53e8a1aa /io_uring | |
| parent | 006cf6583310d39b058c286f633ddf3b6888fd2e (diff) | |
| download | linux-1ae918806c220ffe04737c6368261699d5202acb.tar.gz linux-1ae918806c220ffe04737c6368261699d5202acb.tar.bz2 linux-1ae918806c220ffe04737c6368261699d5202acb.zip | |
io_uring/net: don't pick multiple buffers for non-bundle send
commit 8fe8ac24adcd76b12edbfdefa078567bfff117d4 upstream.
If a send is issued marked with IOSQE_BUFFER_SELECT for selecting a
buffer, unless it's a bundle, it should not select multiple buffers.
Cc: stable@vger.kernel.org
Fixes: a05d1f625c7a ("io_uring/net: support bundles for send")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'io_uring')
| -rw-r--r-- | io_uring/net.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/io_uring/net.c b/io_uring/net.c index d1d69288e2c8..09bb82bc209a 100644 --- a/io_uring/net.c +++ b/io_uring/net.c @@ -591,17 +591,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)) |
