Commit d63b0e8a authored by Pavel Begunkov's avatar Pavel Begunkov Committed by Jens Axboe
Browse files

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: stable@vger.kernel.org
Fixes: b3fdea6e ("io_uring: multishot recv")
Reported-by: default avatarMuhammad Ramdhan <ramdhan@starlabs.sg>
Reported-by: default avatarBing-Jhong Billy Jheng <billy@starlabs.sg>
Reported-by: default avatarJacob Soo <jacob.soo@starlabs.sg>
Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/1bfc9990fe435f1fc6152ca9efeba5eb3e68339c.1738025570.git.asml.silence@gmail.com


Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent a23ad06b
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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;
	}