]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - Grow.c
Grow: do not allow size changes with other changes.
[thirdparty/mdadm.git] / Grow.c
diff --git a/Grow.c b/Grow.c
index 75af6f3a8302c6399b4c39249858721e94827134..27e0d7024c7404fac5da9c510f2057183d434c32 100644 (file)
--- a/Grow.c
+++ b/Grow.c
@@ -524,6 +524,15 @@ int Grow_reshape(char *devname, int fd, int quiet, char *backup_file,
                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")) {