public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH] io_uring: treat -EAGAIN for REQ_F_NOWAIT as final for io-wq
@ 2023-07-20 19:18 Jens Axboe
  0 siblings, 0 replies; only message in thread
From: Jens Axboe @ 2023-07-20 19:18 UTC (permalink / raw)
  To: io-uring

io-wq assumes that an issue is blocking, but it may not be if the
request type has asked for a non-blocking attempt. If we get
-EAGAIN for that case, then we need to treat it as a final result
and not retry or arm poll for it.

Cc: [email protected] # 5.10+
Link: https://github.com/axboe/liburing/issues/897
Signed-off-by: Jens Axboe <[email protected]>

---

diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index a9923676d16d..5e97235a82d6 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -1948,6 +1948,14 @@ void io_wq_submit_work(struct io_wq_work *work)
 		ret = io_issue_sqe(req, issue_flags);
 		if (ret != -EAGAIN)
 			break;
+
+		/*
+		 * If REQ_F_NOWAIT is set, then don't wait or retry with
+		 * poll. -EAGAIN is final for that case.
+		 */
+		if (req->flags & REQ_F_NOWAIT)
+			break;
+
 		/*
 		 * We can get EAGAIN for iopolled IO even though we're
 		 * forcing a sync submission from here, since we can't

-- 
Jens Axboe


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

only message in thread, other threads:[~2023-07-20 19:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-20 19:18 [PATCH] io_uring: treat -EAGAIN for REQ_F_NOWAIT as final for io-wq Jens Axboe

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