diff --git a/super0.c b/super0.c index 99aa3d8..4f58954 100644 --- a/super0.c +++ b/super0.c @@ -893,6 +893,9 @@ static struct supertype *match_metadata_desc0(char *arg) st->minor_version = 90; st->max_devs = MD_SB_DISKS; st->sb = NULL; + /* we sometimes get 00.90 */ + while (arg[0] == '0' && arg[1] == '0') + arg++; if (strcmp(arg, "0") == 0 || strcmp(arg, "0.90") == 0 || strcmp(arg, "default") == 0 || diff --git a/super1.c b/super1.c index 2e3ef53..e71b969 100644 --- a/super1.c +++ b/super1.c @@ -1232,15 +1232,21 @@ static struct supertype *match_metadata_desc1(char *arg) st->ss = &super1; st->max_devs = 384; st->sb = NULL; - if (strcmp(arg, "1.0") == 0) { + /* leading zeros can be safely ignored. --detail generates them. */ + while (*arg == '0') + arg++; + if (strcmp(arg, "1.0") == 0 || + strcmp(arg, "1.00") == 0) { st->minor_version = 0; return st; } - if (strcmp(arg, "1.1") == 0) { + if (strcmp(arg, "1.1") == 0 || + strcmp(arg, "1.01") == 0) { st->minor_version = 1; return st; } - if (strcmp(arg, "1.2") == 0) { + if (strcmp(arg, "1.2") == 0 || + strcmp(arg, "1.02") == 0) { st->minor_version = 2; return st; }