int clean;
int auto_assem = (mddev == NULL && !ident->uuid_set &&
ident->super_minor == UnSet && ident->name[0] == 0
- && ident->container == NULL && ident->member == NULL);
+ && (ident->container == NULL || ident->member == NULL));
int old_linux = 0;
int vers = vers; /* Keep gcc quite - it really is initialised */
struct {
fprintf(stderr, Name ": no recogniseable superblock on %s\n",
devname);
tmpdev->used = 2;
+ } else if (auto_assem && st == NULL &&
+ !conf_test_metadata(tst->ss->name)) {
+ if (report_missmatch)
+ fprintf(stderr, Name ": %s has metadata type %s for which "
+ "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",
if (!st || !st->sb || !content)
return 2;
- /* Now need to open array the device. Use create_mddev */
+ /* Now need to open the array device. Use create_mddev */
if (content == &info)
st->ss->getinfo_super(st, content);
trustworthy = FOREIGN;
+ name = content->name;
switch (st->ss->match_home(st, homehost)
?: st->ss->match_home(st, "any")) {
- case 0:
- trustworthy = FOREIGN;
- name = content->name;
- break;
case 1:
trustworthy = LOCAL;
name = strchr(content->name, ':');
else
name = content->name;
break;
- case -1:
- trustworthy = FOREIGN;
- break;
}
- if (!auto_assem && trustworthy == FOREIGN)
- /* If the array is listed in mdadm or on
+ if (!auto_assem)
+ /* If the array is listed in mdadm.conf or on
* command line, then we trust the name
* even if the array doesn't look local
*/
trustworthy = LOCAL;
- if (content->name[0] == 0 &&
+ if (name[0] == 0 &&
content->array.level == LEVEL_CONTAINER) {
name = content->text_version;
trustworthy = METADATA;