From: Pavel Begunkov Date: Thu, 18 Feb 2021 18:29:39 +0000 (+0000) Subject: io_uring: don't duplicate ->file check in sfr X-Git-Tag: accepted/tizen/unified/20230118.172025~7716^2~21 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=441960f3b9b8ee6aeea847e3e67093e0840e7059;p=platform%2Fkernel%2Flinux-rpi.git io_uring: don't duplicate ->file check in sfr IORING_OP_SYNC_FILE_RANGE is marked as .needs_file, so the common path will take care of assigning and validating req->file, no need to duplicate it in io_sfr_prep(). Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe --- diff --git a/fs/io_uring.c b/fs/io_uring.c index adb5cd4..db6680b 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -4599,9 +4599,6 @@ static int io_sfr_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))