summaryrefslogtreecommitdiffstats
path: root/super1.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2006-05-26 02:29:12 +0000
committerNeil Brown <neilb@suse.de>2006-05-26 02:29:12 +0000
commit2998bc013c2f4a6cc576efab9c0492eb889c8853 (patch)
treef00a3926f097612099930cb96ef7f0a2048a259d /super1.c
parente7bb5d23a9b29ae6f316fe3ce8970301e1bc0d4d (diff)
downloadmdadm-2998bc013c2f4a6cc576efab9c0492eb889c8853.tar.gz
mdadm-2998bc013c2f4a6cc576efab9c0492eb889c8853.tar.xz
mdadm-2998bc013c2f4a6cc576efab9c0492eb889c8853.zip
Improve names reported by --examine --brief
Instead of depending (too much) on what is in /dev, we make names based on the content of the superblock. Signed-off-by: Neil Brown <neilb@suse.de>
Diffstat (limited to 'super1.c')
-rw-r--r--super1.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/super1.c b/super1.c
index 488aabe..9f07ddc 100644
--- a/super1.c
+++ b/super1.c
@@ -308,10 +308,20 @@ static void brief_examine_super1(void *sbv)
{
struct mdp_superblock_1 *sb = sbv;
int i;
+ char *nm;
+
+ nm = strchr(sb->set_name, ':');
+ if (nm)
+ nm++;
+ else if (sb->set_name[0])
+ nm = sb->set_name;
+ else
+ nm = "??";
char *c=map_num(pers, __le32_to_cpu(sb->level));
- printf("ARRAY /dev/?? level=%s metadata=1 num-devices=%d UUID=",
+ printf("ARRAY /dev/md/%s level=%s metadata=1 num-devices=%d UUID=",
+ nm,
c?c:"-unknown-", sb->raid_disks);
for (i=0; i<16; i++) {
printf("%02x", sb->set_uuid[i]);