io_uring: fix cancel of deferred reqs with ->files
authorPavel Begunkov <asml.silence@gmail.com>
Sat, 5 Sep 2020 21:45:14 +0000 (00:45 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 12 Sep 2020 12:22:12 +0000 (14:22 +0200)
commitf5fea75f4ea401df7870ef7bf510c62ac9268745
treeedb6f43a36b16b84aa9fa6d62729014c58f7ea1b
parent4f447bf95fdc7c8ba933f9eb30b0074933b45cca
io_uring: fix cancel of deferred reqs with ->files

[ Upstream commit b7ddce3cbf010edbfac6c6d8cc708560a7bcd7a4 ]

While trying to cancel requests with ->files, it also should look for
requests in ->defer_list, otherwise it might end up hanging a thread.

Cancel all requests in ->defer_list up to the last request there with
matching ->files, that's needed to follow drain ordering semantics.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/io_uring.c