Commit 30dab608 authored by Jens Axboe's avatar Jens Axboe
Browse files

io_uring/futex: always remove futex entry for cancel all



We know the request is either being removed, or already in the process of
being removed through task_work, so we can delete it from our futex list
upfront. This is important for remove all conditions, as we otherwise
will find it multiple times and prevent cancelation progress.

Cc: stable@vger.kernel.org
Fixes: 194bb58c ("io_uring: add support for futex wake and wait")
Fixes: 8f350194 ("io_uring: add support for vectored futex waits")
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 5e3afe58
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -159,6 +159,7 @@ bool io_futex_remove_all(struct io_ring_ctx *ctx, struct task_struct *task,
	hlist_for_each_entry_safe(req, tmp, &ctx->futex_list, hash_node) {
		if (!io_match_task_safe(req, task, cancel_all))
			continue;
		hlist_del_init(&req->hash_node);
		__io_futex_cancel(ctx, req);
		found = true;
	}