]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - Grow.c
FIX: Array after takeover has to be frozen
[thirdparty/mdadm.git] / Grow.c
diff --git a/Grow.c b/Grow.c
index d79e229776cc7251171cb7b756b54174caa2f6a0..958febf40cb34b2eb34e040426a8f2e029fe032d 100644 (file)
--- a/Grow.c
+++ b/Grow.c
@@ -1632,6 +1632,12 @@ static int reshape_array(char *container, int fd, char *devname,
                        return 0;
                goto started;
        }
+       /* The container is frozen but the array may not be.
+        * So freeze the array so spares don't get put to the wrong use
+        * FIXME there should probably be a cleaner separation between
+        * freeze_array and freeze_container.
+        */
+       sysfs_freeze_array(info);
        spares_needed = max(reshape.before.data_disks,
                            reshape.after.data_disks)
                + reshape.parity - array.raid_disks;