io_uring: reinforce cancel on flush during exit
authorPavel Begunkov <asml.silence@gmail.com>
Tue, 9 Feb 2021 04:47:49 +0000 (04:47 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 13 Feb 2021 12:55:01 +0000 (13:55 +0100)
commit88dbd085a51ec78c83dde79ad63bca8aa4272a9d
treee8721d67d5bf6dd0dcd2f06e3ed2003104d7a88b
parentaa435155d396ccccef1af1ba7b1f0b650e1c80e0
io_uring: reinforce cancel on flush during exit

[ Upstream commit 3a7efd1ad269ccaf9c1423364d97c9661ba6dafa ]

What 84965ff8a84f0 ("io_uring: if we see flush on exit, cancel related tasks")
really wants is to cancel all relevant REQ_F_INFLIGHT requests reliably.
That can be achieved by io_uring_cancel_files(), but we'll miss it
calling io_uring_cancel_task_requests(files=NULL) from io_uring_flush(),
because it will go through __io_uring_cancel_task_requests().

Just always call io_uring_cancel_files() during cancel, it's good enough
for now.

Cc: stable@vger.kernel.org # 5.9+
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>
fs/io_uring.c