public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH] io_uring/futex: always remove futex entry for cancel all
@ 2024-03-15 21:54 Jens Axboe
  0 siblings, 0 replies; only message in thread
From: Jens Axboe @ 2024-03-15 21:54 UTC (permalink / raw)
  To: io-uring

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: [email protected]
Fixes: 194bb58c6090 ("io_uring: add support for futex wake and wait")
Fixes: 8f350194d5cf ("io_uring: add support for vectored futex waits")
Signed-off-by: Jens Axboe <[email protected]>

---

diff --git a/io_uring/futex.c b/io_uring/futex.c
index 3c3575303c3d..792a03df58de 100644
--- a/io_uring/futex.c
+++ b/io_uring/futex.c
@@ -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;
 	}

-- 
Jens Axboe


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-03-15 21:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-15 21:54 [PATCH] io_uring/futex: always remove futex entry for cancel all Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox