Skip to contentSkip to conversation

6.12-stable inclusion request

PATCH Jens Axboe 2 participants 2 messages Feb 10 – Feb 12

Subsystems (2)
lore
Share & tools
lore

Jens Axboe

author maintainer
#0 lore raw

Hi,

See:

https://github.com/axboe/liburing/issues/1530

for the reasonings here, but please add this patch to the 6.12-stable queue. Thanks!

Signature · 1 line
Jens Axboe

From a2d2bad7485d2af8dc564c8565839b23a3f8205d Mon Sep 17 00:00:00 2001
From: Jens Axboe <[email protected]>
Date: Wed, 20 Aug 2025 20:03:35 -0600
Subject: [PATCH] io_uring/rw: recycle buffers manually for non-mshot reads

Commit d8e1dec2f860ee40623609aa6c4f22e1ee45605d upstream.

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.

---
 io_uring/rw.c | 2 ++
 1 file changed, 2 insertions(+)
io_uring/rw.c +2 -0
index 996cd4bec482..1a38b3578367 100644
@@ -953,6 +953,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, issue_flags);
 	return ret;
 }
 
Signature · 1 line
2.51.0