]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Examine: make --metadata= work with --brief
authorNeilBrown <neilb@suse.de>
Fri, 10 Jul 2009 00:44:32 +0000 (10:44 +1000)
committerNeilBrown <neilb@suse.de>
Fri, 10 Jul 2009 00:44:32 +0000 (10:44 +1000)
They had different assumptions about the lifetime of 'st'.

Signed-off-by: NeilBrown <neilb@suse.de>
Examine.c

index f0e98f974d2e58885ebc238cdd796690bf4a9dee..46fee95047340942390574be2cf0373f8592b5ff 100644 (file)
--- 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,