summaryrefslogtreecommitdiffstats
path: root/super1.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2009-03-09 10:38:33 +1100
committerNeilBrown <neilb@suse.de>2009-03-09 10:38:33 +1100
commite8e1c176d86433b6d5ebab246257e6f506402fa4 (patch)
treeb347bf3ff1863a821531215fa4e1c7afb6290c5e /super1.c
parent5ea022a16e62ef8d988c9296c7ade501423433d3 (diff)
downloadmdadm-e8e1c176d86433b6d5ebab246257e6f506402fa4.tar.gz
mdadm-e8e1c176d86433b6d5ebab246257e6f506402fa4.tar.xz
mdadm-e8e1c176d86433b6d5ebab246257e6f506402fa4.zip
super1/examine: remove confusing information.
The information about how slots and roles in the array lined up turned out to be confusing. So simplify it and one provide the interesting information. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'super1.c')
-rw-r--r--super1.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/super1.c b/super1.c
index fbb7645..a4978e8 100644
--- a/super1.c
+++ b/super1.c
@@ -205,7 +205,7 @@ static void examine_super1(struct supertype *st, char *homehost)
struct mdp_superblock_1 *sb = st->sb;
time_t atime;
int d;
- int faulty;
+ int role;
int i;
char *c;
int l = homehost ? strlen(homehost) : 0;
@@ -356,6 +356,8 @@ static void examine_super1(struct supertype *st, char *homehost)
default: break;
}
printf("\n");
+#if 0
+ /* This turns out to just be confusing */
printf(" Array Slot : %d (", __le32_to_cpu(sb->dev_number));
for (i= __le32_to_cpu(sb->max_dev); i> 0 ; i--)
if (__le16_to_cpu(sb->dev_roles[i-1]) != 0xffff)
@@ -368,6 +370,18 @@ static void examine_super1(struct supertype *st, char *homehost)
else printf("%d", role);
}
printf(")\n");
+#endif
+ printf(" Device Role : ");
+ d = __le32_to_cpu(sb->dev_number);
+ if (d < sb->raid_disks)
+ role = __le16_to_cpu(sb->dev_roles[d]);
+ else
+ role = 0xFFFF;
+ if (role >= 0xFFFE)
+ printf("spare\n");
+ else
+ printf("Active device %d\n", role);
+
printf(" Array State : ");
for (d=0; d<__le32_to_cpu(sb->raid_disks); d++) {
int cnt = 0;
@@ -382,10 +396,11 @@ static void examine_super1(struct supertype *st, char *homehost)
}
}
if (cnt > 1) printf("?");
- else if (cnt == 1 && me) printf("U");
- else if (cnt == 1) printf("u");
- else printf ("_");
+ else if (cnt == 1) printf("A");
+ else printf (".");
}
+#if 0
+ /* This is confusing too */
faulty = 0;
for (i=0; i< __le32_to_cpu(sb->max_dev); i++) {
int role = __le16_to_cpu(sb->dev_roles[i]);
@@ -393,6 +408,8 @@ static void examine_super1(struct supertype *st, char *homehost)
faulty++;
}
if (faulty) printf(" %d failed", faulty);
+#endif
+ printf(" ('A' == active, '.' == missing)");
printf("\n");
}