summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Sobanski <roman.sobanski@intel.com>2018-04-27 12:12:21 +0200
committerDimitri John Ledkov <xnox@ubuntu.com>2018-05-15 12:10:33 +0100
commit0a7e47e72a9ceaecdeeb960a511281b6fe5b5b4e (patch)
tree3b189127f7aaa62e1dfc8d24aa60c44303d8a5d3
parentd1c489f6ac587671ac1ae264972e6dd69e21cd5f (diff)
[PATCH 9/9] 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> Gbp-Pq: Name 0009-mdadm-grow-correct-size-and-chunk_size-casting.patch
-rw-r--r--Grow.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Grow.c b/Grow.c
index 8722969..a4be7e7 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;
}