io_uring: find and cancel head link async work on files exit
authorJens Axboe <axboe@kernel.dk>
Sun, 16 Aug 2020 15:23:05 +0000 (08:23 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Aug 2020 09:48:58 +0000 (11:48 +0200)
commit917cdc0d2c53637e3cce1a216bfa4e0477c7851b
tree2421eaac19512c45a4b07cba0108290e43cefb13
parent93366cb8105607a890ecc6d742d75c0d0ab58071
io_uring: find and cancel head link async work on files exit

commit b711d4eaf0c408a811311ee3e94d6e9e5a230a9a upstream.

Commit f254ac04c874 ("io_uring: enable lookup of links holding inflight files")
only handled 2 out of the three head link cases we have, we also need to
lookup and cancel work that is blocked in io-wq if that work has a link
that's holding a reference to the files structure.

Put the "cancel head links that hold this request pending" logic into
io_attempt_cancel(), which will to through the motions of finding and
canceling head links that hold the current inflight files stable request
pending.

Cc: stable@vger.kernel.org
Reported-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/io_uring.c