public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH] io_uring/rw: return IOU_ISSUE_SKIP_COMPLETE for multishot retry
@ 2024-03-12 14:32 Jens Axboe
  0 siblings, 0 replies; only message in thread
From: Jens Axboe @ 2024-03-12 14:32 UTC (permalink / raw)
  To: io-uring

If read multishot is being invoked from the poll retry handler, then we
should return IOU_ISSUE_SKIP_COMPLETE rather than -EAGAIN. If not, then
a CQE will be posted with -EAGAIN rather than triggering the retry when
the file is flagged as readable again.

Cc: [email protected]
Reported-by: Sargun Dhillon <[email protected]>
Fixes: fc68fcda04910 ("io_uring/rw: add support for IORING_OP_READ_MULTISHOT")
Signed-off-by: Jens Axboe <[email protected]>

---

diff --git a/io_uring/rw.c b/io_uring/rw.c
index 47e097ab5d7e..0585ebcc9773 100644
--- a/io_uring/rw.c
+++ b/io_uring/rw.c
@@ -947,6 +947,8 @@ int io_read_mshot(struct io_kiocb *req, unsigned int issue_flags)
 		 */
 		if (io_kbuf_recycle(req, issue_flags))
 			rw->len = 0;
+		if (issue_flags & IO_URING_F_MULTISHOT)
+			return IOU_ISSUE_SKIP_COMPLETE;
 		return -EAGAIN;
 	}
 
-- 
Jens Axboe


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-03-12 14:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-12 14:32 [PATCH] io_uring/rw: return IOU_ISSUE_SKIP_COMPLETE for multishot retry Jens Axboe

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