提交 c810acfa 编写于 作者: P Pavel Begunkov 提交者: Cheng Jian

io_uring: remove extra ->file check

mainline inclusion
from mainline-5.6-rc1
commit 9250f9ee
category: feature
bugzilla: https://bugzilla.openeuler.org/show_bug.cgi?id=27
CVE: NA
---------------------------

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: NPavel Begunkov <asml.silence@gmail.com>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
Signed-off-by: Nyangerkun <yangerkun@huawei.com>
Reviewed-by: Nzhangyi (F) <yi.zhang@huawei.com>
Signed-off-by: NCheng Jian <cj.chengjian@huawei.com>
上级 bc188199
...@@ -1857,9 +1857,6 @@ static int io_prep_rw(struct io_kiocb *req, const struct io_uring_sqe *sqe, ...@@ -1857,9 +1857,6 @@ static int io_prep_rw(struct io_kiocb *req, const struct io_uring_sqe *sqe,
unsigned ioprio; unsigned ioprio;
int ret; int ret;
if (!req->file)
return -EBADF;
if (S_ISREG(file_inode(req->file)->i_mode)) if (S_ISREG(file_inode(req->file)->i_mode))
req->flags |= REQ_F_ISREG; req->flags |= REQ_F_ISREG;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册