summaryrefslogtreecommitdiff
path: root/super1.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2012-10-23 17:16:16 +1100
committerNeilBrown <neilb@suse.de>2012-10-23 17:16:16 +1100
commit24c7bc8432b955e7c32d889266f33b5fd75b2f33 (patch)
tree341391bb237ff5eb42654823ed9d9f46fc498b38 /super1.c
parent70c55e36b73827579fcb2dadbb6359ef605191ff (diff)
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.c15
1 files changed, 11 insertions, 4 deletions
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");
}