else if (homehost == NULL ||
st->ss->match_home(st, homehost) != 1)
trustworthy = FOREIGN;
- name_to_use = strchr(info.name, ':');
- if (name_to_use)
- name_to_use++;
else
- name_to_use = info.name;
+ trustworthy = LOCAL;
/* There are three possible sources for 'autof': command line,
* ARRAY line in mdadm.conf, or CREATE line in mdadm.conf.
return Incremental_container(st, devname, verbose, runstop,
autof, trustworthy);
}
+ name_to_use = strchr(info.name, ':');
+ if (name_to_use)
+ name_to_use++;
+ else
+ name_to_use = info.name;
+
+ if ((!name_to_use || name_to_use[0] == 0) &&
+ info.array.level == LEVEL_CONTAINER &&
+ trustworthy == LOCAL) {
+ name_to_use = info.text_version;
+ trustworthy = METADATA;
+ }
+
/* 4/ Check if array exists.
*/
map_lock(&map);
/* Couldn't find an existing array, maybe make a new one */
mdfd = create_mddev(match ? match->devname : NULL,
- info.name, autof, trustworthy, chosen_name);
-
+ name_to_use, autof, trustworthy, chosen_name);
if (mdfd < 0)
return 1;
": container %s now has %d devices\n",
chosen_name, info.array.working_disks);
wait_for(chosen_name);
+ if (runstop < 0)
+ return 0; /* don't try to assemble */
return Incremental(chosen_name, verbose, runstop,
NULL, homehost, autof);
}
active_disks = count_active(st, mdfd, &avail, &info);
if (enough(info.array.level, info.array.raid_disks,
info.array.layout, info.array.state & 1,
- avail, active_disks) == 0) {
+ avail, active_disks) == 0 ||
+ (runstop < 0 && active_disks < info.array.raid_disks)) {
free(avail);
if (verbose >= 0)
fprintf(stderr, Name