public inbox for [email protected]
 help / color / mirror / Atom feed
From: Jens Axboe <[email protected]>
To: [email protected]
Cc: Jens Axboe <[email protected]>, Zorro Lang <[email protected]>
Subject: [PATCH 5/5] io_uring: don't use retry based buffered reads for non-async bdev
Date: Mon, 14 Sep 2020 10:25:55 -0600	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

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 <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
---
 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


      parent reply	other threads:[~2020-09-14 16:28 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-14 16:25 [PATCHSET 0/5] io_uring fixes for 5.9 Jens Axboe
2020-09-14 16:25 ` [PATCH 1/5] io_uring: grab any needed state during defer prep Jens Axboe
2020-09-19 15:27   ` Pavel Begunkov
2020-09-19 16:56     ` Pavel Begunkov
2020-10-02 16:14       ` Pavel Begunkov
2020-10-02 16:34         ` Pavel Begunkov
2020-10-02 17:01           ` Jens Axboe
2020-10-02 17:08             ` Pavel Begunkov
2020-10-02 17:09             ` Jens Axboe
2020-10-02 17:14               ` Pavel Begunkov
2020-09-14 16:25 ` [PATCH 2/5] io_uring: drop 'ctx' ref on task work cancelation Jens Axboe
2020-09-14 16:25 ` [PATCH 3/5] io_uring: don't run task work on an exiting task Jens Axboe
2020-09-14 16:25 ` [PATCH 4/5] io_uring: don't re-setup vecs/iter in io_resumit_prep() is already there Jens Axboe
2020-09-14 16:25 ` Jens Axboe [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox