Commit 2d141dd2 authored by Jens Axboe's avatar Jens Axboe

io-wq: ensure work->task_pid is cleared on init

We use ->task_pid for exit cancellation, but we need to ensure it's
cleared to zero for io_req_work_grab_env() to do the right thing. Take
a suggestion from Bart and clear the whole thing, just setting the
function passed in. This makes it more future proof as well.

Fixes: 36282881 ("io-wq: add io_wq_cancel_pid() to cancel based on a specific pid")
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 3030fd4c
...@@ -81,13 +81,7 @@ struct io_wq_work { ...@@ -81,13 +81,7 @@ struct io_wq_work {
#define INIT_IO_WORK(work, _func) \ #define INIT_IO_WORK(work, _func) \
do { \ do { \
(work)->list.next = NULL; \ *(work) = (struct io_wq_work){ .func = _func }; \
(work)->func = _func; \
(work)->files = NULL; \
(work)->mm = NULL; \
(work)->creds = NULL; \
(work)->fs = NULL; \
(work)->flags = 0; \
} while (0) \ } while (0) \
typedef void (get_work_fn)(struct io_wq_work *); typedef void (get_work_fn)(struct io_wq_work *);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment