return 0;
}
+#ifndef MDASSEMBLE
+
int Manage_runstop(char *devname, int fd, int runstop, int quiet)
{
/* Run or stop the array. array must already be configured
}
} else if (runstop < 0){
if (ioctl(fd, STOP_ARRAY, NULL)) {
- if (!quiet)
+ if (quiet==0)
fprintf(stderr, Name ": fail to stop array %s: %s\n",
devname, strerror(errno));
return 1;
}
+ if (quiet <= 0)
+ fprintf(stderr, Name ": stopped %s\n", devname);
}
return 0;
}
close(dfd);
continue;
}
+ remove_partitions(dfd);
close(dfd);
break;
}
* If so, we can simply re-add it.
*/
st->ss->uuid_from_super(duuid, dsuper);
-
- if (osuper) {
+
+ /* re-add doesn't work for version-1 superblocks
+ * before 2.6.18 :-(
+ */
+ if (array.major_version == 1 &&
+ get_linux_version() <= 2006018)
+ ;
+ else if (osuper) {
st->ss->uuid_from_super(ouuid, osuper);
if (memcmp(duuid, ouuid, sizeof(ouuid))==0) {
/* look close enough for now. Kernel
}
}
}
- for (j=0; j< st->max_devs; j++) {
+ /* in 2.6.17 and earlier, version-1 superblocks won't
+ * use the number we write, but will choose a free number.
+ * we must choose the same free number, which requires
+ * starting at 'raid_disks' and counting up
+ */
+ for (j = array.raid_disks; j< st->max_devs; j++) {
disc.number = j;
if (ioctl(fd, GET_DISK_INFO, &disc))
break;
return 0;
}
+#endif