send/recv bundle fixes
Subsystems (2)
Jens Axboe
maintainercover send/recv bundle fixes
Hi,
Just three minor fixes for 6.11, all marked for stable as well. Two of them fix a missing REQ_F_NEED_CLEANUP being set for recv and send, and the last one fixes non-bundle sends potentially picking more than one buffer. Only bundle sends should do that.
Signature · 1 line
Jens Axboe
Jens Axboe
maintainerPATCH 1/3 io_uring/net: ensure expanded bundle recv gets marked for cleanup
If the iovec inside the kmsg isn't already allocated AND one gets expanded beyond the fixed size, then the request may not already have been marked for cleanup. Ensure that it is.
--- io_uring/net.c | 1 + 1 file changed, 1 insertion(+)
io_uring/net.c +1 -0
@@ -1094,6 +1094,7 @@ static int io_recv_buf_select(struct io_kiocb *req, struct io_async_msghdr *kmsgif (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;
Signature · 1 line
2.43.0
Jens Axboe
maintainerPATCH 2/3 io_uring/net: ensure expanded bundle send gets marked for cleanup
In reply to Jens AxboeIf the iovec inside the kmsg isn't already allocated AND one gets expanded beyond the fixed size, then the request may not already have been marked for cleanup. Ensure that it is.
--- io_uring/net.c | 1 + 1 file changed, 1 insertion(+)
io_uring/net.c +1 -0
@@ -623,6 +623,7 @@ int io_send(struct io_kiocb *req, unsigned int issue_flags)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 ; } }
Signature · 1 line
2.43.0
Jens Axboe
maintainerPATCH 3/3 io_uring/net: don't pick multiple buffers for non-bundle send
In reply to Jens AxboeIf a send is issued marked with IOSQE_BUFFER_SELECT for selecting a buffer, unless it's a bundle, it should not select multiple buffers.
--- io_uring/net.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
io_uring/net.c +3 -2
@@ -601,17 +601,18 @@ int io_send(struct io_kiocb *req, unsigned int issue_flags) .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 ))
Signature · 1 line
2.43.0