Some block devices, like dm, bubble back -EAGAIN through the completion handler. We cannot easily support the retry based buffered aio for those, so catch it early and use the old style io-wq based fallback. Fixes: bcf5a06304d6 ("io_uring: support true async buffered reads, if file provides it") Reported-by: Zorro Lang <zlang@xxxxxxxxxx> Signed-off-by: Jens Axboe <axboe@xxxxxxxxx> --- fs/io_uring.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fs/io_uring.c b/fs/io_uring.c index 05670a615663..c9be9a607401 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -3100,6 +3100,13 @@ static bool io_rw_should_retry(struct io_kiocb *req) if (file_can_poll(req->file) || !(req->file->f_mode & FMODE_BUF_RASYNC)) return false; + /* + * If we can't do nonblock submit without -EAGAIN direct return, + * then don't use the retry based approach. + */ + if (!io_file_supports_async(req->file, READ)) + return false; + wait->wait.func = io_async_buf_func; wait->wait.private = req; wait->wait.flags = 0; -- 2.28.0