Skip to content

Commit 16d5980

Browse files
isilenceaxboe
authored andcommitted
io_uring: fix not initialised work->flags
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 <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent dd821e0 commit 16d5980

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/io_uring.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1096,6 +1096,8 @@ static inline void io_prep_async_work(struct io_kiocb *req,
10961096
{
10971097
const struct io_op_def *def = &io_op_defs[req->opcode];
10981098

1099+
io_req_init_async(req);
1100+
10991101
if (req->flags & REQ_F_ISREG) {
11001102
if (def->hash_reg_file)
11011103
io_wq_hash_work(&req->work, file_inode(req->file));
@@ -1104,7 +1106,6 @@ static inline void io_prep_async_work(struct io_kiocb *req,
11041106
req->work.flags |= IO_WQ_WORK_UNBOUND;
11051107
}
11061108

1107-
io_req_init_async(req);
11081109
io_req_work_grab_env(req, def);
11091110

11101111
*link = io_prep_linked_timeout(req);

0 commit comments

Comments
 (0)