io_uring: fix __io_uring_files_cancel() with TASK_UNINTERRUPTIBLE
authorPavel Begunkov <asml.silence@gmail.com>
Tue, 9 Feb 2021 04:47:43 +0000 (04:47 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 13 Feb 2021 12:54:58 +0000 (13:54 +0100)
commitb462a7beab3fb9fdec832bcf064077828125abf0
tree523eba46177631faa201aa6e204cff72bc705b7e
parentf0ff1a95bfa873e9b5e5883cc07d37fc4ae6bbca
io_uring: fix __io_uring_files_cancel() with TASK_UNINTERRUPTIBLE

[ Upstream commit a1bb3cd58913338e1b627ea6b8c03c2ae82d293f ]

If the tctx inflight number haven't changed because of cancellation,
__io_uring_task_cancel() will continue leaving the task in
TASK_UNINTERRUPTIBLE state, that's not expected by
__io_uring_files_cancel(). Ensure we always call finish_wait() before
retrying.

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