From 4e9a3dd16d656b269f5602624ac4f7109a571368 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Mon, 21 Jul 2014 16:51:53 +1000 Subject: [PATCH] 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 --- Grow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 */ -- 2.47.2