]> www.infradead.org Git - users/dwmw2/linux.git/commit
io_uring: spin for sq thread to idle on shutdown
authorJens Axboe <axboe@kernel.dk>
Tue, 4 Feb 2020 23:48:34 +0000 (16:48 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Feb 2020 12:37:07 +0000 (04:37 -0800)
commit4e345439cf54529d9cefb25c55bc0ce7ec759ce7
tree983f3d77f8cacb86e6237bbd9eb3c85c2741f284
parentf9ce114dfbc4d70d09742b5039487e07402cbd8d
io_uring: spin for sq thread to idle on shutdown

commit df069d80c8e38c19531c392322e9a16617475c44 upstream.

As part of io_uring shutdown, we cancel work that is pending and won't
necessarily complete on its own. That includes requests like poll
commands and timeouts.

If we're using SQPOLL for kernel side submission and we shutdown the
ring immediately after queueing such work, we can race with the sqthread
doing the submission. This means we may miss cancelling some work, which
results in the io_uring shutdown hanging forever.

Cc: stable@vger.kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/io_uring.c