Skip to content

Commit

Permalink
io_uring: fix not initialised work->flags
Browse files Browse the repository at this point in the history
59960b9 ("io_uring: fix lazy work init") tried to fix missing
io_req_init_async(), but left out work.flags and hash. Do it earlier.

Fixes: 7cdaf58 ("io_uring: avoid whole io_wq_work copy for requests completed inline")
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Pavel Begunkov authored and Jens Axboe committed Jul 12, 2020
1 parent dd821e0 commit 16d5980
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/io_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -1096,6 +1096,8 @@ static inline void io_prep_async_work(struct io_kiocb *req,
{
const struct io_op_def *def = &io_op_defs[req->opcode];

io_req_init_async(req);

if (req->flags & REQ_F_ISREG) {
if (def->hash_reg_file)
io_wq_hash_work(&req->work, file_inode(req->file));
Expand All @@ -1104,7 +1106,6 @@ static inline void io_prep_async_work(struct io_kiocb *req,
req->work.flags |= IO_WQ_WORK_UNBOUND;
}

io_req_init_async(req);
io_req_work_grab_env(req, def);

*link = io_prep_linked_timeout(req);
Expand Down

0 comments on commit 16d5980

Please sign in to comment.