]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Fix restarting of reshaping arrays.
authorNeilBrown <neilb@suse.de>
Thu, 29 Jul 2010 03:50:15 +0000 (13:50 +1000)
committerNeilBrown <neilb@suse.de>
Thu, 29 Jul 2010 03:50:15 +0000 (13:50 +1000)
We cannot get stripe_cache_size until after the array have
been activated!!

Signed-off-by: NeilBrown <neilb@suse.de>
Grow.c

diff --git a/Grow.c b/Grow.c
index e466a08e79785992308dd87ba2a32ec02fdcae0a..06343a0512e7226a98f6dac8c0b1a38eedd7d8ed 100644 (file)
--- a/Grow.c
+++ b/Grow.c
@@ -1976,12 +1976,6 @@ int Grow_continue(int mdfd, struct supertype *st, struct mdinfo *info,
        int cache;
        int done = 0;
 
-       sra = sysfs_read(-1, devname2devnum(info->sys_name),
-                        GET_COMPONENT|GET_DEVS|GET_OFFSET|GET_STATE|
-                        GET_CACHE);
-       if (!sra)
-               return 1;
-
        err = sysfs_set_str(info, NULL, "array_state", "readonly");
        if (err)
                return err;
@@ -1989,7 +1983,13 @@ int Grow_continue(int mdfd, struct supertype *st, struct mdinfo *info,
        /* make sure reshape doesn't progress until we are ready */
        sysfs_set_str(info, NULL, "sync_max", "0");
        sysfs_set_str(info, NULL, "array_state", "active"); /* FIXME or clean */
-       
+
+       sra = sysfs_read(-1, devname2devnum(info->sys_name),
+                        GET_COMPONENT|GET_DEVS|GET_OFFSET|GET_STATE|
+                        GET_CACHE);
+       if (!sra)
+               return 1;
+
        /* ndisks is not growing, so raid_disks is old and +delta is new */
        odisks = info->array.raid_disks;
        ndisks = odisks + info->delta_disks;