]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
FIX: size is passed incorrectly
authorKwolek, Adam <adam.kwolek@intel.com>
Wed, 12 Jan 2011 10:42:44 +0000 (21:42 +1100)
committerNeilBrown <neilb@suse.de>
Wed, 12 Jan 2011 10:42:44 +0000 (21:42 +1100)
reshape_super() called from reshape_container() with size set to
info->component_size gives size in reshape_super == -2 due to unsigned
signed conversion (info->component_size is not initializes).

As size is not changed during container reshape '-1' value is passed
to indicate this.

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 b3edbc5928f1fa25b1a50983fd0f3a2277563570..898eb3eb5dcc876dbb5d8a63ee5514e9ccad1838 100644 (file)
--- a/Grow.c
+++ b/Grow.c
@@ -2064,7 +2064,10 @@ int reshape_container(char *container, int cfd, char *devname,
 {
        struct mdinfo *cc = NULL;
 
-       if (reshape_super(st, info->component_size, info->new_level,
+       /* component_size is not meaningful for a container,
+        * so pass '-1' meaning 'no change'
+        */
+       if (reshape_super(st, -1, info->new_level,
                          info->new_layout, info->new_chunk,
                          info->array.raid_disks + info->delta_disks,
                          backup_file, devname, quiet))