Skip to content

Commit

Permalink
io_uring: clear IOCB_WAITQ for non -EIOCBQUEUED return
Browse files Browse the repository at this point in the history
The callback can only be armed, if we get -EIOCBQUEUED returned. It's
important that we clear the WAITQ bit for other cases, otherwise we can
queue for async retry and filemap will assume that we're armed and
return -EAGAIN instead of just blocking for the IO.

Cc: stable@vger.kernel.org # 5.9+
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Jens Axboe committed Mar 5, 2021
1 parent ca0a265 commit b5b0ecb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/io_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -3286,6 +3286,7 @@ static int io_read(struct io_kiocb *req, unsigned int issue_flags)
if (ret == -EIOCBQUEUED)
return 0;
/* we got some bytes, but not all. retry. */
kiocb->ki_flags &= ~IOCB_WAITQ;
} while (ret > 0 && ret < io_size);
done:
kiocb_done(kiocb, ret, issue_flags);
Expand Down

0 comments on commit b5b0ecb

Please sign in to comment.