FIX: Get array information in reshape_array()

Uninitialized array structure is used.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
Adam Kwolek 2011-01-06 18:29:02 +11:00 committed by NeilBrown
parent b335e59305
commit 9ff87c16ce
1 changed files with 4 additions and 0 deletions

4
Grow.c
View File

@ -1632,6 +1632,10 @@ static int reshape_array(char *container, int fd, char *devname,
fprintf(stderr, Name ": %s\n", msg);
return 1;
}
if (ioctl(fd, GET_ARRAY_INFO, &array) != 0) {
dprintf("Canot get array information.\n");
return 1;
}
spares_needed = max(reshape.before.data_disks,
reshape.after.data_disks)
+ reshape.parity - array.raid_disks;