md/raid5: ensure we create a unique name for kmem_cache when mddev has no gendisk

We will shortly allow md devices with no gendisk (they are attached to
a dm-target instead).  That will cause mdname() to return 'mdX'.
There is one place where mdname really needs to be unique: when
creating the name for a slab cache.
So in that case, if there is no gendisk, you the address of the mddev
formatted in HEX to provide a unique name.

Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
NeilBrown
2010-06-01 19:37:25 +10:00
parent c41d4ac40d
commit f4be6b43f1
2 changed files with 9 additions and 5 deletions

View File

@@ -388,7 +388,7 @@ struct raid5_private_data {
* two caches.
*/
int active_name;
char cache_name[2][20];
char cache_name[2][32];
struct kmem_cache *slab_cache; /* for allocating stripes */
int seq_flush, seq_write;