mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 02:21:52 +09:00
io_uring: fix short read retries for non-reg files
commit 9a173346bd upstream.
Sockets and other non-regular files may actually expect short reads to
happen, don't retry reads for them. Because non-reg files don't set
FMODE_BUF_RASYNC and so it won't do second/retry do_read, we can filter
out those cases after first do_read() attempt with ret>0.
Cc: stable@vger.kernel.org # 5.9+
Suggested-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
f3ac7a5996
commit
2df15ef2a9
@@ -3461,7 +3461,7 @@ static int io_read(struct io_kiocb *req, bool force_nonblock,
|
||||
|
||||
/* read it all, or we did blocking attempt. no retry. */
|
||||
if (!iov_iter_count(iter) || !force_nonblock ||
|
||||
(req->file->f_flags & O_NONBLOCK))
|
||||
(req->file->f_flags & O_NONBLOCK) || !(req->flags & REQ_F_ISREG))
|
||||
goto done;
|
||||
|
||||
io_size -= ret;
|
||||
|
||||
Reference in New Issue
Block a user