tmpdev->used = 2;
} else if (tst->ss->load_super(tst,dfd, NULL)) {
if (report_missmatch)
- fprintf( stderr, Name ": no RAID superblock on %s\n",
- devname);
+ fprintf(stderr, Name ": no RAID superblock on %s\n",
+ devname);
+ } else if (tst->ss->compare_super == NULL) {
+ if (report_missmatch)
+ fprintf(stderr, Name ": Cannot assemble %s metadata on %s\n",
+ tst->ss->name, devname);
+ tst->ss->free_super(tst);
+ tmpdev->used = 2;
} else if (auto_assem && st == NULL &&
!conf_test_metadata(tst->ss->name,
tst->ss->match_home(tst, homehost) == 1)) {
(4 * content->array.chunk_size / 4096) + 1);
}
}
+ if (okcnt < (unsigned)content->array.raid_disks) {
+ /* If any devices did not get added
+ * because the kernel rejected them based
+ * on event count, try adding them
+ * again providing the action policy is
+ * 're-add' or greater. The bitmap
+ * might allow them to be included, or
+ * they will become spares.
+ */
+ for (i = 0; i <= bestcnt; i++) {
+ int j = best[i];
+ if (j >= 0 && !devices[j].uptodate) {
+ if (!disk_action_allows(&devices[j].i, st->ss->name, act_re_add))
+ continue;
+ rv = add_disk(mdfd, st, content,
+ &devices[j].i);
+ if (rv == 0 && verbose >= 0)
+ fprintf(stderr,
+ Name ": %s has been re-added.\n",
+ devices[j].devname);
+ }
+ }
+ }
wait_for(mddev, mdfd);
close(mdfd);
if (auto_assem) {