Examine: make --metadata= work with --brief
They had different assumptions about the lifetime of 'st'. Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
parent
fa09d4961e
commit
0ea2b5ef1b
|
@ -63,7 +63,7 @@ int Examine(mddev_dev_t devlist, int brief, int export, int scan,
|
||||||
} *arrays = NULL;
|
} *arrays = NULL;
|
||||||
|
|
||||||
for (; devlist ; devlist=devlist->next) {
|
for (; devlist ; devlist=devlist->next) {
|
||||||
struct supertype *st = forcest;
|
struct supertype *st;
|
||||||
|
|
||||||
fd = dev_open(devlist->devname, O_RDONLY);
|
fd = dev_open(devlist->devname, O_RDONLY);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
|
@ -75,7 +75,9 @@ int Examine(mddev_dev_t devlist, int brief, int export, int scan,
|
||||||
err = 1;
|
err = 1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (!st)
|
if (forcest)
|
||||||
|
st = dup_super(forcest);
|
||||||
|
else
|
||||||
st = guess_super(fd);
|
st = guess_super(fd);
|
||||||
if (st)
|
if (st)
|
||||||
err = st->ss->load_super(st, fd,
|
err = st->ss->load_super(st, fd,
|
||||||
|
|
Loading…
Reference in New Issue