7.3-stable review patch. If anyone has any objections, please let me know. ------------------ From: Shang En Sim Commit 21ddbb14f7c3baab50a2a6c13ee375edc2bbe031 upstream. With IORING_ASYNC_CANCEL_ALL, __io_async_cancel() counts one for each io_try_cancel() call that cancels something. io_futex_cancel() and io_waitid_cancel() cancel every match in one call and return how many, so four futex waits cancelled with CANCEL_ALL give a result of 1. Add the number that they return. Cc: stable@vger.kernel.org Fixes: 194bb58c6090 ("io_uring: add support for futex wake and wait") Fixes: f31ecf671ddc ("io_uring: add IORING_OP_WAITID support") Signed-off-by: Shang En Sim Link: https://patch.msgid.link/20261030050319.1448530-2-sim@shangen.org Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- io_uring/cancel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/io_uring/cancel.c b/io_uring/cancel.c index c7ed51377dea2..a34543cb423cd 100644 --- a/io_uring/cancel.c +++ b/io_uring/cancel.c @@ -198,7 +198,8 @@ static int __io_async_cancel(struct io_cancel_data *cd, break; if (!all) return ret; - nr++; + /* futex and waitid return how many they cancelled */ + nr += max(ret, 1); } while (1); /* slow path, try all io-wq's */ -- 2.53.0