}
int Assemble(struct supertype *st, char *mddev, int mdfd,
- mddev_ident_t ident, char *conffile,
+ mddev_ident_t ident,
mddev_dev_t devlist, char *backup_file,
int readonly, int runstop,
char *update, char *homehost,
return 1;
}
if (devlist == NULL)
- devlist = conf_get_devs(conffile);
+ devlist = conf_get_devs();
else if (mdfd >= 0)
inargv = 1;
if (nextspare < info.array.raid_disks)
nextspare = info.array.raid_disks;
i = nextspare++;
+ } else {
+ if (i >= info.array.raid_disks &&
+ i >= nextspare)
+ nextspare = i+1;
}
if (i < 10000) {
if (i >= bestcnt) {
best = newbest;
bestcnt = newbestcnt;
}
+ if (best[i] >=0 &&
+ devices[best[i]].events == devices[devcnt].events &&
+ devices[best[i]].minor != devices[devcnt].minor &&
+ st->ss->major == 0 &&
+ info.array.level != -4) {
+ /* two different devices with identical superblock.
+ * Could be a mis-detection caused by overlapping
+ * partitions. fail-safe.
+ */
+ fprintf(stderr, Name ": WARNING %s and %s appear"
+ " to have very similar superblocks.\n"
+ " If they are really different, "
+ "please --zero the superblock on one\n"
+ " If they are the same, please remove "
+ "one from the list.\n",
+ devices[best[i]].devname, devname);
+ if (must_close) close(mdfd);
+ return 1;
+ }
if (best[i] == -1
|| devices[best[i]].events < devices[devcnt].events)
best[i] = devcnt;