Skip to content

Commit

Permalink
io_uring: ensure read requests go through -ERESTART* transformation
Browse files Browse the repository at this point in the history
We need to call kiocb_done() for any ret < 0 to ensure that we always
get the proper -ERESTARTSYS (and friends) transformation done.

At some point this should be tied into general error handling, so we
can get rid of the various (mostly network) related commands that check
and perform this substitution.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Jens Axboe committed Aug 25, 2020
1 parent 9dab14b commit 00d23d5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/io_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -3160,7 +3160,8 @@ static int io_read(struct io_kiocb *req, bool force_nonblock,
goto out_free;
return -EAGAIN;
} else if (ret < 0) {
goto out_free;
/* make sure -ERESTARTSYS -> -EINTR is done */
goto done;
}

/* read it all, or we did blocking attempt. no retry. */
Expand Down

0 comments on commit 00d23d5

Please sign in to comment.