summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2020-08-25 21:59:22 +0300
committerJens Axboe <axboe@kernel.dk>2020-08-25 21:59:22 +0300
commit00d23d516e2e7900cd1bd577c1f84794ae7ff3a7 (patch)
tree0873d6156fd575f1cc93236dd17ca105cd46e99d /fs
parent9dab14b81807a40dab8e464ec87043935c562c2c (diff)
downloadlinux-00d23d516e2e7900cd1bd577c1f84794ae7ff3a7.tar.xz
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>
Diffstat (limited to 'fs')
-rw-r--r--fs/io_uring.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index d15139088e4c..d9b88644d5e8 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -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. */