summaryrefslogtreecommitdiff
path: root/super0.c
diff options
context:
space:
mode:
authorDoug Ledford <dledford@redhat.com>2008-10-29 15:05:35 -0400
committerNeilBrown <neilb@suse.de>2008-10-30 08:53:02 +1100
commitd7ee65c960fa8a6886df7416307f57545ddc4460 (patch)
tree996e86fac5fea15cf3e51d5c7f870fcd398451d7 /super0.c
parentb3d3195538e315b3863235731112eee7398d4340 (diff)
Fix bad metadata formatting
Certain operations (Detail.c mainly) would print out the metadata of an array in a format that the scan operation in super0.c and super1.c would later reject as unknown when it was found in the mdadm.conf file. Use a consistent format, but also modify the super0 and super1 match methods to accept the other format without complaint. Signed-off-by: Doug Ledford <dledford@redhat.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'super0.c')
-rw-r--r--super0.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/super0.c b/super0.c
index 71dc39ce..90fdf23d 100644
--- a/super0.c
+++ b/super0.c
@@ -93,7 +93,7 @@ static void examine_super0(struct supertype *st, char *homehost)
char *c;
printf(" Magic : %08x\n", sb->md_magic);
- printf(" Version : %02d.%02d.%02d\n", sb->major_version, sb->minor_version,
+ printf(" Version : %d.%02d.%02d\n", sb->major_version, sb->minor_version,
sb->patch_version);
if (sb->minor_version >= 90) {
printf(" UUID : %08x:%08x:%08x:%08x", sb->set_uuid0, sb->set_uuid1,
@@ -846,6 +846,9 @@ static struct supertype *match_metadata_desc0(char *arg)
st->minor_version = 90;
st->max_devs = MD_SB_DISKS;
st->sb = NULL;
+ /* Eliminate pointless leading 0 from some versions of mdadm -D */
+ if (strncmp(arg, "00.", 3) == 0)
+ arg++;
if (strcmp(arg, "0") == 0 ||
strcmp(arg, "0.90") == 0 ||
strcmp(arg, "default") == 0 ||