dm-bufio: fix warnings about duplicate slab caches
authorMikulas Patocka <mpatocka@redhat.com>
Mon, 11 Nov 2024 15:48:18 +0000 (16:48 +0100)
committerMikulas Patocka <mpatocka@redhat.com>
Mon, 11 Nov 2024 16:04:18 +0000 (17:04 +0100)
commit42964e4b5e3ac95090bdd23ed7da2a941ccd902c
treef253e553f4bd2dfab74357248f7336b95f9b3c0a
parent2d5404caa8c7bb5c4e0435f94b28834ae5456623
dm-bufio: fix warnings about duplicate slab caches

The commit 4c39529663b9 adds a warning about duplicate cache names if
CONFIG_DEBUG_VM is selected. These warnings are triggered by the dm-bufio
code. The dm-bufio code allocates a slab cache with each client. It is
not possible to preallocate the caches in the module init function
because the size of auxiliary per-buffer data is not known at this point.

So, this commit changes dm-bufio so that it appends a unique atomic value
to the cache name, to avoid the warnings.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Fixes: 4c39529663b9 ("slab: Warn on duplicate cache names when DEBUG_VM=y")
drivers/md/dm-bufio.c