Patch "io_uring/waitid: always remove waitid entry for cancel all" has been added to the 6.7-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    io_uring/waitid: always remove waitid entry for cancel all

to the 6.7-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     io_uring-waitid-always-remove-waitid-entry-for-cance.patch
and it can be found in the queue-6.7 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 88a731c4883f361b0adf9ee39538ac4682d088e7
Author: Jens Axboe <axboe@xxxxxxxxx>
Date:   Fri Mar 15 15:42:49 2024 -0600

    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@xxxxxxxxxxxxxxx
    Fixes: f31ecf671ddc ("io_uring: add IORING_OP_WAITID support")
    Signed-off-by: Jens Axboe <axboe@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/io_uring/waitid.c b/io_uring/waitid.c
index 6f851978606d9..77d340666cb95 100644
--- a/io_uring/waitid.c
+++ b/io_uring/waitid.c
@@ -125,12 +125,6 @@ static void io_waitid_complete(struct io_kiocb *req, int ret)
 
 	lockdep_assert_held(&req->ctx->uring_lock);
 
-	/*
-	 * Did cancel find it meanwhile?
-	 */
-	if (hlist_unhashed(&req->hash_node))
-		return;
-
 	hlist_del_init(&req->hash_node);
 
 	ret = io_waitid_finish(req, ret);
@@ -202,6 +196,7 @@ bool io_waitid_remove_all(struct io_ring_ctx *ctx, struct task_struct *task,
 	hlist_for_each_entry_safe(req, tmp, &ctx->waitid_list, hash_node) {
 		if (!io_match_task_safe(req, task, cancel_all))
 			continue;
+		hlist_del_init(&req->hash_node);
 		__io_waitid_cancel(ctx, req);
 		found = true;
 	}




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux