Skip to content

Commit

Permalink
io_uring: treat -EAGAIN for REQ_F_NOWAIT as final for io-wq
Browse files Browse the repository at this point in the history
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: https://github.com/axboe/liburing/issues/897
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Jens Axboe committed Jul 20, 2023
1 parent 6adc227 commit a9be202
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions io_uring/io_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a9be202

Please sign in to comment.