/* 7a/ if not, finish with success. */
if (info.array.level == LEVEL_CONTAINER) {
/* Try to assemble within the container */
- close(mdfd);
map_unlock(&map);
sysfs_uevent(&info, "change");
if (verbose >= 0)
fprintf(stderr, Name
": container %s now has %d devices\n",
chosen_name, info.array.working_disks);
- wait_for(chosen_name);
+ wait_for(chosen_name, mdfd);
+ close(mdfd);
if (runstop < 0)
return 0; /* don't try to assemble */
return Incremental(chosen_name, verbose, runstop,
": %s attached to %s, which has been started.\n",
devname, chosen_name);
rv = 0;
- wait_for(chosen_name);
+ wait_for(chosen_name, mdfd);
} else {
fprintf(stderr, Name
": %s attached to %s, but failed to start: %s.\n",
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",