diff options
author | Jens Axboe <axboe@kernel.dk> | 2021-03-05 07:02:58 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-03-25 11:04:13 +0300 |
commit | 76f496681d6a125d28321deda355ca14d0e4ad23 (patch) | |
tree | c4eb8028807b1796edcfe7b77ab2d235f96ecdb6 /fs | |
parent | 3c08f772ad0db70876021aa5d276e14747f77512 (diff) | |
download | linux-76f496681d6a125d28321deda355ca14d0e4ad23.tar.xz |
io_uring: clear IOCB_WAITQ for non -EIOCBQUEUED return
[ Upstream commit b5b0ecb736f1ce1e68eb50613c0cfecff10198eb ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs')
-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 7625b3e2db2c..06e9c2181995 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -3501,6 +3501,7 @@ retry: goto out_free; } else if (ret > 0 && ret < io_size) { /* we got some bytes, but not all. retry. */ + kiocb->ki_flags &= ~IOCB_WAITQ; goto retry; } done: |