]> www.infradead.org Git - users/dwmw2/linux.git/commit
io_uring: make sure async workqueue is canceled on exit
authorJens Axboe <axboe@kernel.dk>
Thu, 2 Jul 2020 01:30:14 +0000 (21:30 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jul 2020 07:37:49 +0000 (09:37 +0200)
commit1c4404efcf2c01a89152d160487746e056f6de1f
treecdd4474b9d401dfd53852d40a2e7f29bc208c651
parente75220890bf6b37c5f7b1dbd81d8292ed6d96643
io_uring: make sure async workqueue is canceled on exit

Track async work items that we queue, so we can safely cancel them
if the ring is closed or the process exits. Newer kernels handle
this automatically with io-wq, but the old workqueue based setup needs
a bit of special help to get there.

There's no upstream variant of this, as that would require backporting
all the io-wq changes from 5.5 and on. Hence I made a one-off that
ensures that we don't leak memory if we have async work items that
need active cancelation (like socket IO).

Reported-by: Agarwal, Anchal <anchalag@amazon.com>
Tested-by: Agarwal, Anchal <anchalag@amazon.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/io_uring.c