NeilBrown: Examine: make --metadata= work with --brief

Martin F. Krafft madduck at alioth.debian.org
Tue Oct 27 19:45:09 UTC 2009


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

Author: NeilBrown <neilb at suse.de>
Date:   Fri Jul 10 10:44:32 2009 +1000

Examine: make --metadata= work with --brief

They had different assumptions about the lifetime of 'st'.

Signed-off-by: NeilBrown <neilb at suse.de>

---

 Examine.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/Examine.c b/Examine.c
index f0e98f9..46fee95 100644
--- a/Examine.c
+++ b/Examine.c
@@ -63,7 +63,7 @@ int Examine(mddev_dev_t devlist, int brief, int export, int scan,
 	} *arrays = NULL;
 
 	for (; devlist ; devlist=devlist->next) {
-		struct supertype *st = forcest;
+		struct supertype *st;
 
 		fd = dev_open(devlist->devname, O_RDONLY);
 		if (fd < 0) {
@@ -75,7 +75,9 @@ int Examine(mddev_dev_t devlist, int brief, int export, int scan,
 			err = 1;
 		}
 		else {
-			if (!st)
+			if (forcest)
+				st = dup_super(forcest);
+			else
 				st = guess_super(fd);
 			if (st)
 				err = st->ss->load_super(st, fd,




More information about the pkg-mdadm-commits mailing list