diff options
author | NeilBrown <neilb@suse.de> | 2012-10-23 08:16:16 +0200 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2012-10-23 08:16:16 +0200 |
commit | 24c7bc8432b955e7c32d889266f33b5fd75b2f33 (patch) | |
tree | 341391bb237ff5eb42654823ed9d9f46fc498b38 /super1.c | |
parent | Add support for --replace and --with (diff) | |
download | mdadm-24c7bc8432b955e7c32d889266f33b5fd75b2f33.tar.xz mdadm-24c7bc8432b955e7c32d889266f33b5fd75b2f33.zip |
Report replacement devices correctly with --detail and --examine
--detail needs to be read to report 2 devices in each slot,
and --examine need to report if the device is the original or
the replacement.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'super1.c')
-rw-r--r-- | super1.c | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -461,6 +461,8 @@ static void examine_super1(struct supertype *st, char *homehost) role = 0xFFFF; if (role >= 0xFFFE) printf("spare\n"); + else if (sb->feature_map & __cpu_to_le32(MD_FEATURE_REPLACEMENT)) + printf("Replacement device %d\n", role); else printf("Active device %d\n", role); @@ -473,9 +475,14 @@ static void examine_super1(struct supertype *st, char *homehost) if (role == d) cnt++; } - if (cnt > 1) printf("?"); - else if (cnt == 1) printf("A"); - else printf ("."); + if (cnt == 2) + printf("R"); + else if (cnt == 1) + printf("A"); + else if (cnt == 0) + printf("."); + else + printf("?"); } #if 0 /* This is confusing too */ @@ -487,7 +494,7 @@ static void examine_super1(struct supertype *st, char *homehost) } if (faulty) printf(" %d failed", faulty); #endif - printf(" ('A' == active, '.' == missing)"); + printf(" ('A' == active, '.' == missing, 'R' == replacing)"); printf("\n"); } |