summaryrefslogtreecommitdiffstats
path: root/Grow.c
diff options
context:
space:
mode:
authorRoman Sobanski <roman.sobanski@intel.com>2018-04-27 12:12:21 +0200
committerJes Sorensen <jsorensen@fb.com>2018-04-27 15:30:32 +0200
commit5d518de84e7cd3382b4984cc1243ddb4102aa4f4 (patch)
treefb48b204eacce149b07354c58f1919a88457799f /Grow.c
parentPrevent create IMSM volume with size smaller than 1M or chunk (diff)
downloadmdadm-5d518de84e7cd3382b4984cc1243ddb4102aa4f4.tar.xz
mdadm-5d518de84e7cd3382b4984cc1243ddb4102aa4f4.zip
mdadm/grow: correct size and chunk_size casting
With commit 4b74a905a67e ("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>
Diffstat (limited to 'Grow.c')
-rw-r--r--Grow.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Grow.c b/Grow.c
index 87229692..a4be7e7b 100644
--- a/Grow.c
+++ b/Grow.c
@@ -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;
}