Skip to content

Commit

Permalink
io_uring: ensure async buffered read-retry is setup properly
Browse files Browse the repository at this point in the history
ANBZ: torvalds#190

commit f38c7e3 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: 227c0c9 ("io_uring: internally retry short reads")
Reported-by: Hao_Xu <haoxu@linux.alibaba.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Reviewed-by: Xiaoguang Wang <xiaoguang.wang@linux.alibaba.com>
Reviewed-by: Hao Xu <haoxu@linux.alibaba.com>
Tested-by: Hao Xu <haoxu@linux.alibaba.com>
  • Loading branch information
axboe authored and josephhz committed Dec 31, 2021
1 parent 092a04c commit 3b7f3e0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions fs/io_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 3b7f3e0

Please sign in to comment.