diff options
author | Jens Axboe <axboe@kernel.dk> | 2021-03-05 05:02:58 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-03-05 16:43:09 +0100 |
commit | b5b0ecb736f1ce1e68eb50613c0cfecff10198eb (patch) | |
tree | 2bbe77a9b47c89fa01c46e198e0bcafbfe1e00b1 /fs/io_uring.c | |
parent | io_uring: don't keep looping for more events if we can't flush overflow (diff) | |
download | linux-b5b0ecb736f1ce1e68eb50613c0cfecff10198eb.tar.xz linux-b5b0ecb736f1ce1e68eb50613c0cfecff10198eb.zip |
io_uring: clear IOCB_WAITQ for non -EIOCBQUEUED return
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>
Diffstat (limited to '')
-rw-r--r-- | fs/io_uring.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c index 044170165402..5762750c666c 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -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); |