Patch "block: mark blk_put_queue as potentially blocking" has been added to the 6.1-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

    block: mark blk_put_queue as potentially blocking

to the 6.1-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:
     block-mark-blk_put_queue-as-potentially-blocking.patch
and it can be found in the queue-6.1 subdirectory.

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



commit 85f3aa689549aa5f0056587ffbea5891bab6fb53
Author: Christoph Hellwig <hch@xxxxxx>
Date:   Mon Nov 14 05:26:37 2022 +0100

    block: mark blk_put_queue as potentially blocking
    
    [ Upstream commit 63f93fd6fa5717769a78d6d7bea6f7f9a1ccca8e ]
    
    We can't just say that the last reference release may block, as any
    reference dropped could be the last one.  So move the might_sleep() from
    blk_free_queue to blk_put_queue and update the documentation.
    
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Link: https://lore.kernel.org/r/20221114042637.1009333-6-hch@xxxxxx
    Signed-off-by: Jens Axboe <axboe@xxxxxxxxx>
    Stable-dep-of: d36a9ea5e776 ("block: fix use-after-free of q->q_usage_counter")
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/block/blk-core.c b/block/blk-core.c
index 7de1bb16e9a7..815ffce6b988 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -260,8 +260,6 @@ static void blk_free_queue_rcu(struct rcu_head *rcu_head)
 
 static void blk_free_queue(struct request_queue *q)
 {
-	might_sleep();
-
 	percpu_ref_exit(&q->q_usage_counter);
 
 	if (q->poll_stat)
@@ -285,11 +283,11 @@ static void blk_free_queue(struct request_queue *q)
  * Decrements the refcount of the request_queue and free it when the refcount
  * reaches 0.
  *
- * Context: Any context, but the last reference must not be dropped from
- *          atomic context.
+ * Context: Can sleep.
  */
 void blk_put_queue(struct request_queue *q)
 {
+	might_sleep();
 	if (refcount_dec_and_test(&q->refs))
 		blk_free_queue(q);
 }



[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