From e0280e19a9862a332d15c8901bb922b21aed34c0 Mon Sep 17 00:00:00 2001 From: Pavel Begunkov Date: Sat, 1 Feb 2020 01:22:08 +0300 Subject: [PATCH 1206/2944] io_uring: remove extra ->file check to #26323588 commit 9250f9ee194dc3dcee28a42a1533fa2cc0edd215 upstream. It won't ever get into io_prep_rw() when req->file haven't been set in io_req_set_file(), hence remove the check. Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe Signed-off-by: Joseph Qi Acked-by: Xiaoguang Wang --- fs/io_uring.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/fs/io_uring.c b/fs/io_uring.c index 356ee0e..65a06cd 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -1859,9 +1859,6 @@ static int io_prep_rw(struct io_kiocb *req, const struct io_uring_sqe *sqe, unsigned ioprio; int ret; - if (!req->file) - return -EBADF; - if (S_ISREG(file_inode(req->file)->i_mode)) req->flags |= REQ_F_ISREG; -- 1.8.3.1