summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2020-07-12 16:16:47 +0300
committerJens Axboe <axboe@kernel.dk>2020-07-12 09:40:50 -0600
commit16d598030a37853a7a6b4384cad19c9c0af2f021 (patch)
tree06f76c2f18cdb892f5740951845ac46fdd6ddb8b /fs
parentdd821e0c95a64b5923a0c57f07d3f7563553e756 (diff)
downloadlinux-stable-16d598030a37853a7a6b4384cad19c9c0af2f021.tar.gz
linux-stable-16d598030a37853a7a6b4384cad19c9c0af2f021.tar.bz2
linux-stable-16d598030a37853a7a6b4384cad19c9c0af2f021.zip
io_uring: fix not initialised work->flags
59960b9deb535 ("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: 7cdaf587de7c ("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>
Diffstat (limited to 'fs')
-rw-r--r--fs/io_uring.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 5570d6aeaff8..9fd7e69696c3 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -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));
@@ -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);