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 <killian.de.volder@megasoft.be>
Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
NeilBrown 2014-07-21 16:51:53 +10:00
parent d31ad6439e
commit 4e9a3dd16d
1 changed files with 1 additions and 1 deletions

2
Grow.c
View File

@ -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
*/