From 3b7f3e05758280c30857db1c066b63a67496a609 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Fri, 25 Sep 2020 15:23:43 -0600 Subject: [PATCH] io_uring: ensure async buffered read-retry is setup properly ANBZ: #190 commit f38c7e3abfba9a9e180b34f642254c43782e7ffe upstream. A previous commit for fixing up short reads botched the async retry path, so we ended up going to worker threads more often than we should. Fix this up, so retries work the way they originally were intended to. Fixes: 227c0c9673d8 ("io_uring: internally retry short reads") Reported-by: Hao_Xu Signed-off-by: Jens Axboe Signed-off-by: Joseph Qi Reviewed-by: Xiaoguang Wang Reviewed-by: Hao Xu Tested-by: Hao Xu --- fs/io_uring.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/io_uring.c b/fs/io_uring.c index 99a2a16cf90164..5ecb68f4a7f3d3 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -3101,10 +3101,8 @@ static int io_read(struct io_kiocb *req, bool force_nonblock) goto done; /* some cases will consume bytes even on error returns */ iov_iter_revert(iter, iov_count - iov_iter_count(iter)); - ret = io_setup_async_rw(req, iovec, inline_vecs, iter, false); - if (ret) - goto out_free; - return -EAGAIN; + ret = 0; + goto copy_iov; } else if (ret < 0) { goto out_free; }