Assemble: fix some recently introduced bugs. From: NeilBrown Found during testing: - cannot check metadata for homehost before loading metadata. Signed-off-by: NeilBrown --- Assemble.c | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Assemble.c b/Assemble.c index 326edb3..476498a 100644 --- a/Assemble.c +++ b/Assemble.c @@ -260,6 +260,10 @@ int Assemble(struct supertype *st, char *mddev, fprintf(stderr, Name ": no recogniseable superblock on %s\n", devname); tmpdev->used = 2; + } else if (tst->ss->load_super(tst,dfd, NULL)) { + if (report_missmatch) + fprintf( stderr, Name ": no RAID superblock on %s\n", + devname); } else if (auto_assem && st == NULL && !conf_test_metadata(tst->ss->name, tst->ss->match_home(tst, homehost) == 1)) { @@ -268,10 +272,7 @@ int Assemble(struct supertype *st, char *mddev, "auto-assembly is disabled\n", devname, tst->ss->name); tmpdev->used = 2; - } else if (tst->ss->load_super(tst,dfd, NULL)) { - if (report_missmatch) - fprintf( stderr, Name ": no RAID superblock on %s\n", - devname); + tst->ss->free_super(tst); } else { content = &info; memset(content, 0, sizeof(*content));