public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH 1/1] io_uring: fix multishots with selected buffers
@ 2025-01-28  0:55 Pavel Begunkov
  2025-01-28 14:07 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Begunkov @ 2025-01-28  0:55 UTC (permalink / raw)
  To: io-uring
  Cc: Jens Axboe, Muhammad Ramdhan, Bing-Jhong Billy Jheng, Jacob Soo,
	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.

Cc: [email protected]
Fixes: b3fdea6ecb55c ("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]>
---
 io_uring/poll.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/io_uring/poll.c b/io_uring/poll.c
index cc01c40b43d31..f12a857bb8555 100644
--- a/io_uring/poll.c
+++ b/io_uring/poll.c
@@ -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;
 	}
-- 
2.47.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] io_uring: fix multishots with selected buffers
  2025-01-28  0:55 [PATCH 1/1] io_uring: fix multishots with selected buffers Pavel Begunkov
@ 2025-01-28 14:07 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2025-01-28 14:07 UTC (permalink / raw)
  To: io-uring, Pavel Begunkov
  Cc: Muhammad Ramdhan, Bing-Jhong Billy Jheng, Jacob Soo


On Tue, 28 Jan 2025 00:55:24 +0000, Pavel Begunkov wrote:
> 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,
-- 
Jens Axboe




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-01-28 14:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-28  0:55 [PATCH 1/1] io_uring: fix multishots with selected buffers Pavel Begunkov
2025-01-28 14:07 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox