Skip to content

Commit b5b0ecb

Browse files
committed
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>
1 parent ca0a265 commit b5b0ecb

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

fs/io_uring.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3286,6 +3286,7 @@ static int io_read(struct io_kiocb *req, unsigned int issue_flags)
32863286
if (ret == -EIOCBQUEUED)
32873287
return 0;
32883288
/* we got some bytes, but not all. retry. */
3289+
kiocb->ki_flags &= ~IOCB_WAITQ;
32893290
} while (ret > 0 && ret < io_size);
32903291
done:
32913292
kiocb_done(kiocb, ret, issue_flags);

0 commit comments

Comments
 (0)