]> www.infradead.org Git - nvme.git/commitdiff
block: fix 'kmem_cache of name 'bio-108' already exists'
authorMing Lei <ming.lei@redhat.com>
Fri, 28 Feb 2025 13:26:56 +0000 (21:26 +0800)
committerJens Axboe <axboe@kernel.dk>
Fri, 28 Feb 2025 14:06:42 +0000 (07:06 -0700)
Device mapper bioset often has big bio_slab size, which can be more than
1000, then 8byte can't hold the slab name any more, cause the kmem_cache
allocation warning of 'kmem_cache of name 'bio-108' already exists'.

Fix the warning by extending bio_slab->name to 12 bytes, but fix output
of /proc/slabinfo

Reported-by: Guangwu Zhang <guazhang@redhat.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20250228132656.2838008-1-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bio.c

index f0c416e5931d97ebbc8bbf7fd41d3e7bb9dfa9a7..6ac5983ba51e6c95bb7a3e2e9ffcbd886ea48e11 100644 (file)
@@ -77,7 +77,7 @@ struct bio_slab {
        struct kmem_cache *slab;
        unsigned int slab_ref;
        unsigned int slab_size;
-       char name[8];
+       char name[12];
 };
 static DEFINE_MUTEX(bio_slab_lock);
 static DEFINE_XARRAY(bio_slabs);