Neil Brown: Fix support for --update=swapsuper

Martin F. Krafft madduck at alioth.debian.org
Tue Jun 24 22:01:51 UTC 2008


Module: mdadm
Branch: upstream
Commit: ff1f6545dba0cc2e8c9561cf10de236579d6f58c
URL:    http://git.debian.org/?p=pkg-mdadm/mdadm.git;a=commit;h=ff1f6545dba0cc2e8c9561cf10de236579d6f58c

Author: Neil Brown <neilb at suse.de>
Date:   Thu May 15 15:50:48 2008 +1000

Fix support for --update=swapsuper

The user of dup_super broke it.

---

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

diff --git a/super0.c b/super0.c
index f2d6d63..7e81482 100644
--- a/super0.c
+++ b/super0.c
@@ -856,7 +856,8 @@ static struct supertype *match_metadata_desc0(char *arg)
 		return st;
 
 	st->minor_version = 9; /* flag for 'byte-swapped' */
-	if (strcmp(arg, "0.swap")==0)
+	if (strcmp(arg, "0.swap")==0 ||
+	    strcmp(arg, "0.9") == 0) /* For dup_super support */
 		return st;
 
 	free(st);
diff --git a/util.c b/util.c
index 1ad6fd0..6efb88a 100644
--- a/util.c
+++ b/util.c
@@ -781,7 +781,8 @@ struct supertype *dup_super(struct supertype *st)
 	for (i = 0; stnew == NULL && superlist[i] ; i++)
 		stnew = superlist[i]->match_metadata_desc(verstr);
 
-	stnew->sb = NULL;
+	if (stnew)
+		stnew->sb = NULL;
 	return stnew;
 }
 




More information about the pkg-mdadm-commits mailing list