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;
-
- if ((!name_to_use || name_to_use[0] == 0) &&
- info.array.level == LEVEL_CONTAINER &&
- trustworthy == LOCAL) {
- name_to_use = info.text_version;
- trustworthy = METADATA;
- }
-
+ 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);
": 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
mp = map_by_uuid(&map, ra->uuid);
- if (!mp) {
+ if (mp) {
+ mdfd = open_dev(mp->devnum);
+ strcpy(chosen_name, mp->path);
+ } else {
/* Check in mdadm.conf for devices == devname and
* member == ra->text_version after second slash.
array_list->member);
break;
}
- }
- mdfd = create_mddev(match ? match->devname : NULL,
- ra->name,
- autof,
- trustworthy,
- chosen_name);
+ mdfd = create_mddev(match ? match->devname : NULL,
+ ra->name,
+ autof,
+ trustworthy,
+ chosen_name);
+ }
if (mdfd < 0) {
fprintf(stderr, Name ": failed to open %s: %s.\n",