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
3286 if (ret == -EIOCBQUEUED)3286 if (ret == -EIOCBQUEUED)
3287 return 0;3287 return 0;
3288 /* we got some bytes, but not all. retry. */3288 /* we got some bytes, but not all. retry. */
3289 kiocb->ki_flags &= ~IOCB_WAITQ;
3289 } while (ret > 0 && ret < io_size);3290 } while (ret > 0 && ret < io_size);
3290done:3291done:
3291 kiocb_done(kiocb, ret, issue_flags);3292 kiocb_done(kiocb, ret, issue_flags);