return 1;
}
+ if (size >= 0 &&
+ (chunksize || level!= UnSet || layout_str || raid_disks)) {
+ fprintf(stderr, Name ": cannot change component size at the same time "
+ "as other changes.\n"
+ " Change size first, then check data is intact before "
+ "making other changes.\n");
+ return 1;
+ }
+
if (raid_disks && raid_disks < array.raid_disks && array.level > 1 &&
get_linux_version() < 2006032 &&
!check_env("MDADM_FORCE_FEWER")) {
if (array_size >= 0) {
/* alway impose array size first, independent of
* anything else
+ * Do not allow level or raid_disks changes at the
+ * same time as that can be irreversibly destructive.
*/
struct mdinfo sra;
int err;
+ if (raiddisks || level != UnSet) {
+ fprintf(stderr, Name ": cannot change array size in same operation "
+ "as changing raiddisks or level.\n"
+ " Change size first, then check that data is still intact.\n");
+ rv = 1;
+ break;
+ }
sysfs_init(&sra, mdfd, 0);
if (array_size == 0)
err = sysfs_set_str(&sra, NULL, "array_size", "default");