fprintf(stderr, Name ": %s is a container, but we are looking for components\n",
devname);
tmpdev->used = 2;
+#if !defined(MDASSEMBLE) || defined(MDASSEMBLE) && defined(MDASSEMBLE_AUTO)
} if (!tst && (tst = super_by_fd(dfd, NULL)) == NULL) {
if (report_missmatch)
fprintf(stderr, Name ": not a recognisable container: %s\n",
devname);
tmpdev->used = 2;
+#endif
} else if (!tst->ss->load_container
|| tst->ss->load_container(tst, dfd, NULL)) {
if (report_missmatch)
tmpdev->devname, strerror(errno));
tmpdev->used = 2;
} else {
- struct dev_policy *pol = NULL;
- pol = devnum_policy(stb.st_rdev);
- if (domain_test(domains, pol, NULL))
- /* take this spare if domains match */
+ struct dev_policy *pol = devnum_policy(stb.st_rdev);
+ int dt = domain_test(domains, pol, NULL);
+ if (inargv && dt != 0)
+ /* take this spare as domains match
+ * if there are any */
+ tmpdev->used = 1;
+ else if (!inargv && dt == 1)
+ /* device wasn't explicitly listed, so need
+ * explicit domain match - which we have */
tmpdev->used = 1;
else
/* if domains don't match mark as unused */
content->array.raid_disks);
fprintf(stderr, "\n");
}
+ st->ss->free_super(st);
sysfs_uevent(content, "change");
wait_for(chosen_name, mdfd);
close(mdfd);