]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
FIX: Fiddle raid_disks number when restarting reshape
authorAdam Kwolek <adam.kwolek@intel.com>
Mon, 18 Apr 2011 00:31:06 +0000 (10:31 +1000)
committerNeilBrown <neilb@suse.de>
Mon, 18 Apr 2011 00:31:06 +0000 (10:31 +1000)
When restarting a reshape, the value of 'raid_disks' is the *new*
value.  The old value is found by subtracting delta_disks.
So before calling analyse_change we must set raid_disks to be the
old value, and then reset it afterwards.

All other fields are cleanly separated with the main field being
the 'old' value and a new_* field available.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Grow.c

diff --git a/Grow.c b/Grow.c
index 017a79dbda49b5e3f2b64b469e7c62111617170d..9c1f096a25375c3f07249451b6c6f89ed5eb012b 100644 (file)
--- a/Grow.c
+++ b/Grow.c
@@ -1676,8 +1676,10 @@ static int reshape_array(char *container, int fd, char *devname,
        if (info->reshape_active) {
                int new_level = info->new_level;
                info->new_level = UnSet;
+               info->array.raid_disks -= info->delta_disks;
                msg = analyse_change(info, &reshape);
                info->new_level = new_level;
+               info->array.raid_disks += info->delta_disks;
                if (!restart)
                        /* Make sure the array isn't read-only */
                        ioctl(fd, RESTART_ARRAY_RW, 0);