mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 04:18:39 +08:00
io_uring/net: don't pick multiple buffers for non-bundle send
commit8fe8ac24ad
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:a05d1f625c
("io_uring/net: support bundles for send") Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
006cf65833
commit
1ae918806c
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user