mdadm/grow: correct size and chunk_size casting

With commit 4b74a905a6
("mdadm/grow: Component size must be larger than chunk size") mdadm returns
incorrect message if size given to grow was greater than 2 147 483 647 K.
Cast chunk_size to "unsigned long long" instead of casting size to "int".

Signed-off-by: Roman Sobanski <roman.sobanski@intel.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
This commit is contained in:
Roman Sobanski 2018-04-27 12:12:21 +02:00 committed by Jes Sorensen
parent 54865c30d5
commit 5d518de84e
1 changed files with 1 additions and 1 deletions

2
Grow.c
View File

@ -1821,7 +1821,7 @@ int Grow_reshape(char *devname, int fd,
}
if (array.level > 1 && s->size > 1 &&
(array.chunk_size / 1024) > (int)s->size) {
(unsigned long long) (array.chunk_size / 1024) > s->size) {
pr_err("component size must be larger than chunk size.\n");
return 1;
}