io_uring: halt SQO submission on ctx exit
authorPavel Begunkov <asml.silence@gmail.com>
Sun, 14 Mar 2021 20:57:11 +0000 (20:57 +0000)
committerJens Axboe <axboe@kernel.dk>
Mon, 15 Mar 2021 15:31:19 +0000 (09:31 -0600)
commit8f2f1b95b1b0e16396293ccdb9f0734e100ac2e2
tree505d49072419c524a166635ffe365d31caa03ca3
parentf5ca390a27d505ef191389c6b7ab5236c2a624c8
io_uring: halt SQO submission on ctx exit

io_sq_thread_finish() is called in io_ring_ctx_free(), so SQPOLL task is
potentially running submitting new requests. It's not a disaster because
of using a "try" variant of percpu_ref_get, but is far from nice.

Remove ctx from the sqd ctx list earlier, before cancellation loop, so
SQPOLL can't find it and so won't submit new requests.

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