]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Grow:make sure 'array' is up-to-date before SET_ARRAY_INFO
authorNeilBrown <neilb@suse.de>
Mon, 31 Jan 2011 04:30:15 +0000 (15:30 +1100)
committerNeilBrown <neilb@suse.de>
Mon, 31 Jan 2011 04:30:15 +0000 (15:30 +1100)
The value of 'array' might not be current, so SET_ARRAY_INFO
and fail.  Just refresh it before setting raid_disks.

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

diff --git a/Grow.c b/Grow.c
index e12b5271a97fc3a8737d6ea143fae52691fb9e62..da39af762fe284f9edec6a73535ae8f136d1700a 100644 (file)
--- a/Grow.c
+++ b/Grow.c
@@ -1914,6 +1914,7 @@ started:
            reshape.before.layout == reshape.after.layout &&
            st->ss->external == 0) {
                /* use SET_ARRAY_INFO but only if reshape hasn't started */
+               ioctl(fd, GET_ARRAY_INFO, &array);
                array.raid_disks = reshape.after.data_disks + reshape.parity;
                if (!info->reshape_active &&
                    ioctl(fd, SET_ARRAY_INFO, &array) != 0) {