summaryrefslogtreecommitdiff
path: root/fs/io_uring.c
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2021-02-18 18:29:39 +0000
committerJens Axboe <axboe@kernel.dk>2021-02-18 13:13:18 -0700
commit441960f3b9b8ee6aeea847e3e67093e0840e7059 (patch)
treeb3b16e04aef5f748c19c457dbe9ab8c6e0e23a17 /fs/io_uring.c
parent1155c76a248364dd182bde90fea6f5682a6a766f (diff)
downloadlwn-441960f3b9b8ee6aeea847e3e67093e0840e7059.tar.gz
lwn-441960f3b9b8ee6aeea847e3e67093e0840e7059.zip
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 <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/io_uring.c')
-rw-r--r--fs/io_uring.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index adb5cd4b760d..db6680bb02d3 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))