]> git.itanic.dy.fi Git - linux-stable/commit
io_uring/waitid: always remove waitid entry for cancel all
authorJens Axboe <axboe@kernel.dk>
Fri, 15 Mar 2024 21:42:49 +0000 (15:42 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Apr 2024 13:32:24 +0000 (15:32 +0200)
commitc5ecafc2ea363c12cc5811021b9a6542d5793898
tree31b4a5b78b796eed8c2efef67449090c7fbd19d1
parentb52e6693fdb3523117df1f6c6cf5efe996105961
io_uring/waitid: always remove waitid entry for cancel all

[ Upstream commit 2b35b8b43e07b1a6f06fdd84cf4b9eb24785896d ]

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 waitid list
upfront. This is important for remove all conditions, as we otherwise
will find it multiple times and prevent cancelation progress.

Remove the dead check in cancelation as well for the hash_node being
empty or not. We already have a waitid reference check for ownership,
so we don't need to check the list too.

Cc: stable@vger.kernel.org
Fixes: f31ecf671ddc ("io_uring: add IORING_OP_WAITID support")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
io_uring/waitid.c