summaryrefslogtreecommitdiff
path: root/io_uring/rw.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2025-08-20 20:03:35 -0600
committerJens Axboe <axboe@kernel.dk>2025-08-24 11:41:12 -0600
commitd8e1dec2f860ee40623609aa6c4f22e1ee45605d (patch)
tree94298abcc141bce7537fdcbb3a5935ad55cc8950 /io_uring/rw.c
parentab6559bdbb08f6bee606435cd014fc5ba0f7b750 (diff)
io_uring/rw: recycle buffers manually for non-mshot reads
The mshot side of reads already does this, but the regular read path does not. This leads to needing recycling checks sprinkled in various spots in the "go async" path, like arming poll. In preparation for getting rid of those, ensure that read recycles appropriately. Link: https://lore.kernel.org/r/20250821020750.598432-8-axboe@kernel.dk Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/rw.c')
-rw-r--r--io_uring/rw.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/io_uring/rw.c b/io_uring/rw.c
index ef94cdde5f1f..2b106f644383 100644
--- a/io_uring/rw.c
+++ b/io_uring/rw.c
@@ -1026,6 +1026,8 @@ int io_read(struct io_kiocb *req, unsigned int issue_flags)
if (ret >= 0)
return kiocb_done(req, ret, issue_flags);
+ if (req->flags & REQ_F_BUFFERS_COMMIT)
+ io_kbuf_recycle(req, req->buf_list, issue_flags);
return ret;
}