Skip to content

Commit a9be202

Browse files
committed
io_uring: treat -EAGAIN for REQ_F_NOWAIT as final for io-wq
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: stable@vger.kernel.org # 5.10+ Link: axboe/liburing#897 Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 6adc227 commit a9be202

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

io_uring/io_uring.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1948,6 +1948,14 @@ void io_wq_submit_work(struct io_wq_work *work)
19481948
ret = io_issue_sqe(req, issue_flags);
19491949
if (ret != -EAGAIN)
19501950
break;
1951+
1952+
/*
1953+
* If REQ_F_NOWAIT is set, then don't wait or retry with
1954+
* poll. -EAGAIN is final for that case.
1955+
*/
1956+
if (req->flags & REQ_F_NOWAIT)
1957+
break;
1958+
19511959
/*
19521960
* We can get EAGAIN for iopolled IO even though we're
19531961
* forcing a sync submission from here, since we can't

0 commit comments

Comments
 (0)