]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Assemble: Fix honouring of 'auto' config line
authorNeilBrown <neilb@suse.de>
Tue, 6 Jul 2010 01:57:09 +0000 (11:57 +1000)
committerNeilBrown <neilb@suse.de>
Tue, 6 Jul 2010 01:57:09 +0000 (11:57 +1000)
commit 1ff98339283645a20c980d540f6c4d82693e7daf
broke the checking of metadata types via the 'auto' line.

Be moving 'load_super" before "conf_test_metadata" we left
tst->sb set even if conf_test_metadata fails, so the device will
actually be accepted and used.

So if we decide to reject the device, free the superblock so it is
clear that it is rejected.

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

index 1504f1f45585ff2f19a764c48f62755ff7666a0e..c5d28edc8da7f850562f27ab4ac9aedc50946ed0 100644 (file)
@@ -271,6 +271,7 @@ int Assemble(struct supertype *st, char *mddev,
                                fprintf(stderr, Name ": %s has metadata type %s for which "
                                        "auto-assembly is disabled\n",
                                        devname, tst->ss->name);
+                       tst->ss->free_super(tst);
                        tmpdev->used = 2;
                } else {
                        content = &info;