提交 710c2bfb 编写于 作者: P Pavel Begunkov 提交者: Jens Axboe

io_uring: fix missing io_grab_files()

We won't have valid ring_fd, ring_file in task work. Grab files early.
Signed-off-by: NPavel Begunkov <asml.silence@gmail.com>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
上级 a6d45dd0
...@@ -5270,15 +5270,15 @@ static int io_req_defer_prep(struct io_kiocb *req, ...@@ -5270,15 +5270,15 @@ static int io_req_defer_prep(struct io_kiocb *req,
if (!sqe) if (!sqe)
return 0; return 0;
if (for_async || (req->flags & REQ_F_WORK_INITIALIZED)) { if (io_op_defs[req->opcode].file_table) {
io_req_init_async(req); io_req_init_async(req);
ret = io_grab_files(req);
if (unlikely(ret))
return ret;
}
if (io_op_defs[req->opcode].file_table) { if (for_async || (req->flags & REQ_F_WORK_INITIALIZED)) {
ret = io_grab_files(req); io_req_init_async(req);
if (unlikely(ret))
return ret;
}
io_req_work_grab_env(req, &io_op_defs[req->opcode]); io_req_work_grab_env(req, &io_op_defs[req->opcode]);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册