Skip to contentSkip to conversation

io_uring: fix multishots with selected buffers

PATCH Applied Pavel Begunkov 2 participants 2 messages Jan 28, 2025 io_uring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 io_uring: fix multishots with selected buffers

We do io_kbuf_recycle() when arming a poll but every iteration of a multishot can grab more buffers, which is why we need to flush the kbuf ring state before continuing with waiting.

---
 io_uring/poll.c | 2 ++
 1 file changed, 2 insertions(+)
io_uring/poll.c +2 -0
index cc01c40b43d31..f12a857bb8555 100644
@@ -315,8 +315,10 @@ void io_poll_task_func(struct io_kiocb *req, struct io_tw_state *ts)
 
 	ret = io_poll_check_events(req, ts);
 	if (ret == IOU_POLL_NO_ACTION) {
+		io_kbuf_recycle(req, 0);
 		return;
 	} else if (ret == IOU_POLL_REQUEUE) {
+		io_kbuf_recycle(req, 0);
 		__io_poll_execute(req, 0);
 		return;
 	}
Signature · 1 line
2.47.1
maintainer Applied
#1 lore raw
Quoted 5 lines · Pavel Begunkov

We do io_kbuf_recycle() when arming a poll but every iteration of a multishot can grab more buffers, which is why we need to flush the kbuf ring state before continuing with waiting.

Applied, thanks!

[1/1] io_uring: fix multishots with selected buffers

      commit: d63b0e8a628e62ca85a0f7915230186bb92f8bb4

Best regards,

Signature · 1 line
Jens Axboe