2020-01-31 22:24:11

by Pavel Begunkov

[permalink] [raw]
Subject: [PATCH 1/1] io_uring: remove extra ->file check

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 <[email protected]>
---
fs/io_uring.c | 3 ---
1 file changed, 3 deletions(-)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index 799e80e85027..426b0dd81cca 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -1868,9 +1868,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;

--
2.24.0


2020-01-31 22:25:26

by Jens Axboe

[permalink] [raw]
Subject: Re: [PATCH 1/1] io_uring: remove extra ->file check

On 1/31/20 3:22 PM, Pavel Begunkov wrote:
> 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.

Applied for 5.6, thanks.

--
Jens Axboe