]> git.itanic.dy.fi Git - linux-stable/commitdiff
io_uring: don't check req->file in io_fsync_prep()
authorJens Axboe <axboe@kernel.dk>
Wed, 30 Mar 2022 17:06:02 +0000 (11:06 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Apr 2022 18:59:22 +0000 (20:59 +0200)
commit ec858afda857e361182ceafc3d2ba2b164b8e889 upstream.

This is a leftover from the really old days where we weren't able to
track and error early if we need a file and it wasn't assigned. Kill
the check.

Cc: stable@vger.kernel.org # v5.15+
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/io_uring.c

index 2faa558778ba95c81a749fb4e20d51c962506f1f..e291d5e1e749d5a8ed4bc81cea6b301e0690a888 100644 (file)
@@ -4128,9 +4128,6 @@ static int io_fsync_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
 {
        struct io_ring_ctx *ctx = req->ctx;
 
-       if (!req->file)
-               return -EBADF;
-
        if (unlikely(ctx->flags & IORING_SETUP_IOPOLL))
                return -EINVAL;
        if (unlikely(sqe->addr || sqe->ioprio || sqe->buf_index ||