Thread (2 messages) 2 messages, 1 author, 2021-01-21
STALE1971d

[PATCH 1/1] io_uring: fix short read retries for non-reg files

From: Pavel Begunkov <asml.silence@gmail.com>
Date: 2021-01-21 00:32:03
Also in: io-uring
Subsystem: filesystems (vfs and infrastructure), the rest · Maintainers: Alexander Viro, Christian Brauner, Linus Torvalds

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

Cc: stable@vger.kernel.org # 5.9+
Suggested-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help