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)
committerJens Axboe <axboe@kernel.dk>
Sun, 16 Aug 2020 21:36:31 +0000 (14:36 -0700)
commitb711d4eaf0c408a811311ee3e94d6e9e5a230a9a
tree12865258c97160581ba36671d77f54ad57df7e0c
parent9123e3a74ec7b934a4a099e98af6a61c2f80bbf5
io_uring: find and cancel head link async work on files exit

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>
fs/io_uring.c