Skip to content

Commit 00d23d5

Browse files
committed
io_uring: ensure read requests go through -ERESTART* transformation
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>
1 parent 9dab14b commit 00d23d5

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

fs/io_uring.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3160,7 +3160,8 @@ static int io_read(struct io_kiocb *req, bool force_nonblock,
31603160
goto out_free;
31613161
return -EAGAIN;
31623162
} else if (ret < 0) {
3163-
goto out_free;
3163+
/* make sure -ERESTARTSYS -> -EINTR is done */
3164+
goto done;
31643165
}
31653166

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

0 commit comments

Comments
 (0)