Skip to content

Commit

Permalink
block: fix 'kmem_cache of name 'bio-108' already exists'
Browse files Browse the repository at this point in the history
mainline inclusion
from mainline-v6.14-rc5
category: bugfix

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 <[email protected]>
Signed-off-by: Ming Lei <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jens Axboe <[email protected]>
(cherry picked from commit b654f7a51ffb386131de42aa98ed831f8c126546)
Signed-off-by: Wentao Guan <[email protected]>
  • Loading branch information
Ming Lei authored and opsiff committed Mar 3, 2025
1 parent b11cfb2 commit 2bbfb8f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion block/bio.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,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);
Expand Down

0 comments on commit 2bbfb8f

Please sign in to comment.