Skip to content

Commit 8828729

Browse files
committed
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
2 parents 377773d + 8fe8ac2 commit 8828729

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

io_uring/net.c

Lines changed: 5 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))
@@ -623,6 +624,7 @@ int io_send(struct io_kiocb *req, unsigned int issue_flags)
623624
if (arg.iovs != &kmsg->fast_iov && arg.iovs != kmsg->free_iov) {
624625
kmsg->free_iov_nr = ret;
625626
kmsg->free_iov = arg.iovs;
627+
req->flags |= REQ_F_NEED_CLEANUP;
626628
}
627629
}
628630

@@ -1094,6 +1096,7 @@ static int io_recv_buf_select(struct io_kiocb *req, struct io_async_msghdr *kmsg
10941096
if (arg.iovs != &kmsg->fast_iov && arg.iovs != kmsg->free_iov) {
10951097
kmsg->free_iov_nr = ret;
10961098
kmsg->free_iov = arg.iovs;
1099+
req->flags |= REQ_F_NEED_CLEANUP;
10971100
}
10981101
} else {
10991102
void __user *buf;

0 commit comments

Comments
 (0)