Skip to content

Commit 30dab60

Browse files
committed
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: 194bb58 ("io_uring: add support for futex wake and wait") Fixes: 8f35019 ("io_uring: add support for vectored futex waits") Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 5e3afe5 commit 30dab60

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

io_uring/futex.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ bool io_futex_remove_all(struct io_ring_ctx *ctx, struct task_struct *task,
159159
hlist_for_each_entry_safe(req, tmp, &ctx->futex_list, hash_node) {
160160
if (!io_match_task_safe(req, task, cancel_all))
161161
continue;
162+
hlist_del_init(&req->hash_node);
162163
__io_futex_cancel(ctx, req);
163164
found = true;
164165
}

0 commit comments

Comments
 (0)