Skip to content
Commit eb2de941 authored by Jens Axboe's avatar Jens Axboe
Browse files

io-wq: fix race around io_worker grabbing



There's a small window between lookup dropping the reference to the
worker and calling wake_up_process() on the worker task, where the worker
itself could have exited. We ensure that the worker struct itself is
valid, but worker->task may very well be gone by the time we issue the
wakeup.

Fix the race by using a completion triggered by the reference going to
zero, and having exit wait for that completion before proceeding.

Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 8b3e78b5
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