io_uring: break out of iowq iopoll on teardown
authorPavel Begunkov <asml.silence@gmail.com>
Tue, 12 Sep 2023 13:57:06 +0000 (14:57 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 Sep 2023 10:27:54 +0000 (12:27 +0200)
commit605d055452e7abed4aca012953aecc79c09baf12
tree01d316e8225d0d82924fc7d23df2c837d32117e9
parentb04f22b68643d35b3e0823ea92295b203ef83bf3
io_uring: break out of iowq iopoll on teardown

[ upstream commit 45500dc4e01c167ee063f3dcc22f51ced5b2b1e9 ]

io-wq will retry iopoll even when it failed with -EAGAIN. If that
races with task exit, which sets TIF_NOTIFY_SIGNAL for all its workers,
such workers might potentially infinitely spin retrying iopoll again and
again and each time failing on some allocation / waiting / etc. Don't
keep spinning if io-wq is dying.

Fixes: 561fb04a6a225 ("io_uring: replace workqueue usage with io-wq")
Cc: stable@vger.kernel.org
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
io_uring/io-wq.c
io_uring/io-wq.h
io_uring/io_uring.c