Grow: fix problem with validating chunk size

When checking if the new chunk size fit in the component size
we were confusing sectors and K, and so getting it wrong.

Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
NeilBrown 2010-03-09 14:14:39 +11:00
parent 056b331efe
commit be1cabbd29
1 changed files with 2 additions and 2 deletions

4
Grow.c
View File

@ -573,7 +573,7 @@ int Grow_reshape(char *devname, int fd, int quiet, char *backup_file,
goto release;
}
ioctl(fd, GET_ARRAY_INFO, &array);
size = get_component_size(fd);
size = get_component_size(fd)/2;
if (size == 0)
size = array.size;
if (!quiet)
@ -581,7 +581,7 @@ int Grow_reshape(char *devname, int fd, int quiet, char *backup_file,
devname, size);
changed = 1;
} else {
size = get_component_size(fd);
size = get_component_size(fd)/2;
if (size == 0)
size = array.size;
}