From: NeilBrown Date: Mon, 21 Jul 2014 06:51:53 +0000 (+1000) Subject: Grow: fix that preventing resize of array to 32bit size. X-Git-Tag: mdadm-3.3.2~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4e9a3dd16d656b269f5602624ac4f7109a571368;p=thirdparty%2Fmdadm.git Grow: fix that preventing resize of array to 32bit size. If the request --size to --grow an array to is 32bits (i.e. msb in bit 32) then mdadm make wrong choice and uses ioctl instead of setting component_size via sysfs and the change is ignored. This is fixed by using correct casts. Reported-and-tested-by: Killian De Volder Signed-off-by: NeilBrown --- diff --git a/Grow.c b/Grow.c index ea9cc60e..af59347c 100644 --- a/Grow.c +++ b/Grow.c @@ -1813,7 +1813,7 @@ int Grow_reshape(char *devname, int fd, if (s->size == MAX_SIZE) s->size = 0; array.size = s->size; - if ((unsigned)array.size != s->size) { + if (array.size != (signed)s->size) { /* got truncated to 32bit, write to * component_size instead */