NeilBrown: Revert change to handling of -empty-string- metadata.

Martin F. Krafft madduck at alioth.debian.org
Sun Aug 29 11:54:51 UTC 2010


Module: mdadm
Branch: fixes/udev-blkid
Commit: 5082750467726d7cad6059ee8a41713da23426d3
URL:    http://git.debian.org/?p=pkg-mdadm/mdadm.git;a=commit;h=5082750467726d7cad6059ee8a41713da23426d3

Author: NeilBrown <neilb at suse.de>
Date:   Mon May 31 12:08:02 2010 +1000

Revert change to handling of -empty-string- metadata.

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 at debian.org>
Signed-off-by: NeilBrown <neilb at suse.de>

---

 super0.c |    3 ++-
 super1.c |    3 +--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/super0.c b/super0.c
index 5c6b7d7..a0c7eb4 100644
--- 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 ||
-	    strcmp(arg, "0.90") == 0
+	    strcmp(arg, "0.90") == 0 ||
+	    strcmp(arg, "") == 0 /* no metadata  - i.e. non_persistent */
 		)
 		return st;
 
diff --git a/super1.c b/super1.c
index f3be7ce..8fa0745 100644
--- 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 ||
-	    strcmp(arg, "1.01") == 0 ||
-	    strcmp(arg, "") == 0 /* no metadata */
+	    strcmp(arg, "1.01") == 0
 		) {
 		st->minor_version = 1;
 		return st;




More information about the pkg-mdadm-commits mailing list