]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: fix sqpoll cancellation via task_work
authorPavel Begunkov <asml.silence@gmail.com>
Mon, 15 Mar 2021 14:23:08 +0000 (14:23 +0000)
committerJens Axboe <axboe@kernel.dk>
Mon, 15 Mar 2021 15:32:40 +0000 (09:32 -0600)
commit22bfe1f1e112fe553aa4f37e18d431d731cbd21b
tree2ad3c494d8f86a89c2d3ec30db5852df025c1cd8
parent4682126c1fa7ae8f99d6b3108f831873cbb495c7
io_uring: fix sqpoll cancellation via task_work

Running sqpoll cancellations via task_work_run() is a bad idea because
it depends on other task works to be run, but those may be locked in
currently running task_work_run() because of how it's (splicing the list
in batches).

Enqueue and run them through a separate callback head, namely
struct io_sq_data::park_task_work. As a nice bonus we now precisely
control where it's run, that's much safer than guessing where it can
happen as it was before.

Reported-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c