History

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.

Jens Axboe committed 5 years ago

Commit b5b0ecb1 parent ca0a2651 file · +1 −0Browse files

Unified · Split

fs/io_uring.c+1−0
@@ -3286,6 +3286,7 @@ static int io_read(struct io_kiocb *req, unsigned int issue_flags) · 3285 unmodified lines
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);