public inbox for [email protected]
 help / color / mirror / Atom feed
From: Pavel Begunkov <[email protected]>
To: Jens Axboe <[email protected]>, [email protected]
Cc: [email protected]
Subject: [PATCH 1/1] io_uring: fix short read retries for non-reg files
Date: Wed, 20 Jan 2021 23:09:02 +0000	[thread overview]
Message-ID: <096d4c7e2615704c08786fe793e91ad8b22cb9f9.1611184076.git.asml.silence@gmail.com> (raw)

Sockets and other non-regular files may actually expect short reads to
happen, don't retry reads for them.

Cc: [email protected] # 5.9+
Suggested-by: Jens Axboe <[email protected]>
Signed-off-by: Pavel Begunkov <[email protected]>
---
 fs/io_uring.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index 5f6f1e48954e..544d711b2ef0 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -3557,6 +3557,9 @@ static int io_read(struct io_kiocb *req, bool force_nonblock,
 
 	io_size -= ret;
 copy_iov:
+	if (!(req->flags & REQ_F_ISREG) && ret > 0)
+		goto done;
+
 	ret2 = io_setup_async_rw(req, iovec, inline_vecs, iter, true);
 	if (ret2) {
 		ret = ret2;
-- 
2.24.0


             reply	other threads:[~2021-01-21  0:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-20 23:09 Pavel Begunkov [this message]
2021-01-20 23:50 ` [PATCH 1/1] io_uring: fix short read retries for non-reg files Pavel Begunkov

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 \
    --in-reply-to=096d4c7e2615704c08786fe793e91ad8b22cb9f9.1611184076.git.asml.silence@gmail.com \
    [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