From 24c7bc8432b955e7c32d889266f33b5fd75b2f33 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Tue, 23 Oct 2012 17:16:16 +1100 Subject: 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 --- super1.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'super1.c') diff --git a/super1.c b/super1.c index 99933863..dd6b9be1 100644 --- a/super1.c +++ b/super1.c @@ -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"); } -- cgit v1.2.3