Patch "bcache: use MAX_CACHES_PER_SET instead of magic number 8 in __bch_bucket_alloc_set" has been added to the 4.19-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

    bcache: use MAX_CACHES_PER_SET instead of magic number 8 in __bch_bucket_alloc_set

to the 4.19-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:
     bcache-use-max_caches_per_set-instead-of-magic-numbe.patch
and it can be found in the queue-4.19 subdirectory.

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



commit 941d9f22890e6eb81644a08c42752e0c49f92837
Author: Shenghui Wang <shhuiw@xxxxxxxxxxx>
Date:   Mon Oct 8 20:41:19 2018 +0800

    bcache: use MAX_CACHES_PER_SET instead of magic number 8 in __bch_bucket_alloc_set
    
    [ Upstream commit 8792099f9ad487cf381f4e8199ff2158ba0f6eb5 ]
    
    Current cache_set has MAX_CACHES_PER_SET caches most, and the macro
    is used for
    "
            struct cache *cache_by_alloc[MAX_CACHES_PER_SET];
    "
    in the define of struct cache_set.
    
    Use MAX_CACHES_PER_SET instead of magic number 8 in
    __bch_bucket_alloc_set.
    
    Signed-off-by: Shenghui Wang <shhuiw@xxxxxxxxxxx>
    Signed-off-by: Coly Li <colyli@xxxxxxx>
    Signed-off-by: Jens Axboe <axboe@xxxxxxxxx>
    Stable-dep-of: 80fca8a10b60 ("bcache: Fix __bch_btree_node_alloc to make the failure behavior consistent")
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/md/bcache/alloc.c b/drivers/md/bcache/alloc.c
index 46794cac167e7..a1df0d95151c6 100644
--- a/drivers/md/bcache/alloc.c
+++ b/drivers/md/bcache/alloc.c
@@ -497,7 +497,7 @@ int __bch_bucket_alloc_set(struct cache_set *c, unsigned int reserve,
 		return -1;
 
 	lockdep_assert_held(&c->bucket_lock);
-	BUG_ON(!n || n > c->caches_loaded || n > 8);
+	BUG_ON(!n || n > c->caches_loaded || n > MAX_CACHES_PER_SET);
 
 	bkey_init(k);
 



[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