Skip to content

Commit 8fe8ac2

Browse files
committed
io_uring/net: don't pick multiple buffers for non-bundle send
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: [email protected] Fixes: a05d1f6 ("io_uring/net: support bundles for send") Signed-off-by: Jens Axboe <[email protected]>
1 parent 70ed519 commit 8fe8ac2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

io_uring/net.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -601,17 +601,18 @@ int io_send(struct io_kiocb *req, unsigned int issue_flags)
601601
.iovs = &kmsg->fast_iov,
602602
.max_len = INT_MAX,
603603
.nr_iovs = 1,
604-
.mode = KBUF_MODE_EXPAND,
605604
};
606605

607606
if (kmsg->free_iov) {
608607
arg.nr_iovs = kmsg->free_iov_nr;
609608
arg.iovs = kmsg->free_iov;
610-
arg.mode |= KBUF_MODE_FREE;
609+
arg.mode = KBUF_MODE_FREE;
611610
}
612611

613612
if (!(sr->flags & IORING_RECVSEND_BUNDLE))
614613
arg.nr_iovs = 1;
614+
else
615+
arg.mode |= KBUF_MODE_EXPAND;
615616

616617
ret = io_buffers_select(req, &arg, issue_flags);
617618
if (unlikely(ret < 0))

0 commit comments

Comments
 (0)