diff options
author | Jens Axboe <axboe@kernel.dk> | 2024-03-16 00:37:15 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-04-03 16:32:24 +0300 |
commit | b52e6693fdb3523117df1f6c6cf5efe996105961 (patch) | |
tree | e3deeeb7f7e68897d9ae54a6735a228b7d2a714c /io_uring | |
parent | 73857f99780464b83fa2861364c1b8ec60648303 (diff) | |
download | linux-b52e6693fdb3523117df1f6c6cf5efe996105961.tar.xz |
io_uring/futex: always remove futex entry for cancel all
[ Upstream commit 30dab608c3cb99c2a05b76289fd05551703979ae ]
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: 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 <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'io_uring')
-rw-r--r-- | io_uring/futex.c | 1 |
1 files changed, 1 insertions, 0 deletions
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; } |