Skip to content

Commit d63b0e8

Browse files
isilenceaxboe
authored andcommitted
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. Cc: [email protected] Fixes: b3fdea6 ("io_uring: multishot recv") Reported-by: Muhammad Ramdhan <[email protected]> Reported-by: Bing-Jhong Billy Jheng <[email protected]> Reported-by: Jacob Soo <[email protected]> Signed-off-by: Pavel Begunkov <[email protected]> Link: https://lore.kernel.org/r/1bfc9990fe435f1fc6152ca9efeba5eb3e68339c.1738025570.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <[email protected]>
1 parent a23ad06 commit d63b0e8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

io_uring/poll.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,10 @@ void io_poll_task_func(struct io_kiocb *req, struct io_tw_state *ts)
315315

316316
ret = io_poll_check_events(req, ts);
317317
if (ret == IOU_POLL_NO_ACTION) {
318+
io_kbuf_recycle(req, 0);
318319
return;
319320
} else if (ret == IOU_POLL_REQUEUE) {
321+
io_kbuf_recycle(req, 0);
320322
__io_poll_execute(req, 0);
321323
return;
322324
}

0 commit comments

Comments
 (0)