]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Revert change to handling of -empty-string- metadata.
authorNeilBrown <neilb@suse.de>
Mon, 31 May 2010 02:08:02 +0000 (12:08 +1000)
committerNeilBrown <neilb@suse.de>
Mon, 31 May 2010 02:08:02 +0000 (12:08 +1000)
If the metadata is an empty string, it means the array in question
does not use metadata.  This comes from sysfs_read finding "none" in
"metadata_version", then super_by_fd noticing the vers == -1, and so
just using the ->text_version (which is empty).

In this case we want to use the super0 metadata handler routines
because that is what we always used to do before

 commit 7d5c3964ccfaace123f7b75e15d38c2650e013d8

And that commit was wrong because "" doesn't mean "default" and so
should not have been changed at the same time.

Reported-by: martin f. krafft <madduck@debian.org>
Signed-off-by: NeilBrown <neilb@suse.de>
super0.c
super1.c

index 5c6b7d71984e831ba0b9640e04b0f6093aa85022..a0c7eb4f15db90063ccffdf9055ff0ac70e9bf05 100644 (file)
--- a/super0.c
+++ b/super0.c
@@ -922,7 +922,8 @@ static struct supertype *match_metadata_desc0(char *arg)
        while (arg[0] == '0' && arg[1] == '0')
                arg++;
        if (strcmp(arg, "0") == 0 ||
        while (arg[0] == '0' && arg[1] == '0')
                arg++;
        if (strcmp(arg, "0") == 0 ||
-           strcmp(arg, "0.90") == 0
+           strcmp(arg, "0.90") == 0 ||
+           strcmp(arg, "") == 0 /* no metadata  - i.e. non_persistent */
                )
                return st;
 
                )
                return st;
 
index f3be7cef40e697f14f7dca222f961cdd9573cdd9..8fa074531fbacf6ed7efec9d86b2885264d8e9da 100644 (file)
--- a/super1.c
+++ b/super1.c
@@ -1375,8 +1375,7 @@ static struct supertype *match_metadata_desc1(char *arg)
                return st;
        }
        if (strcmp(arg, "1.1") == 0 ||
                return st;
        }
        if (strcmp(arg, "1.1") == 0 ||
-           strcmp(arg, "1.01") == 0 ||
-           strcmp(arg, "") == 0 /* no metadata */
+           strcmp(arg, "1.01") == 0
                ) {
                st->minor_version = 1;
                return st;
                ) {
                st->minor_version = 1;
                return st;