mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 14:11:52 +00:00
io_uring: ensure async buffered read-retry is setup properly
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: 227c0c9673
("io_uring: internally retry short reads")
Reported-by: Hao_Xu <haoxu@linux.alibaba.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
62c774ed48
commit
f38c7e3abf
@ -3172,10 +3172,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) {
|
||||
/* make sure -ERESTARTSYS -> -EINTR is done */
|
||||
goto done;
|
||||
|
Loading…
Reference in New Issue
Block a user