]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
io_uring: ensure read requests go through -ERESTART* transformation
authorJens Axboe <axboe@kernel.dk>
Tue, 25 Aug 2020 18:59:22 +0000 (12:59 -0600)
committerJens Axboe <axboe@kernel.dk>
Tue, 25 Aug 2020 18:59:22 +0000 (12:59 -0600)
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>
fs/io_uring.c

index d15139088e4c189136dc886f0a03adc2bc2eed00..d9b88644d5e8a0a3db1bb31adc861ecf5a458006 100644 (file)
@@ -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. */