mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2026-10-14 05:55:17 +00:00
io-wq: fix races around manager/worker creation and task exit
These races have always been there, they are just more apparent now that we do early cancel of io-wq when the task exits. Ensure that the io-wq manager sets task state correctly to not miss wakeups for task creation. This is important if we get a wakeup after having marked ourselves as TASK_INTERRUPTIBLE. If we do end up creating workers, then we flip the state back to running, making the subsequent schedule() a no-op. Also increment the wq ref count before forking the thread, to avoid a use-after-free. Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
8a378fb096
commit
8b3e78b595
1 changed files with 35 additions and 22 deletions
57
fs/io-wq.c
57
fs/io-wq.c
Loading…
Add table
Add a link
Reference in a new issue