From: Zhilong Liu Date: Thu, 23 Nov 2017 03:10:44 +0000 (+0800) Subject: mdadm/grow: correct the s->size > 1 to make 'max' work X-Git-Tag: mdadm-4.1-rc1~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=56e1e6ace095893b361f26e750eee58fe3068340;p=thirdparty%2Fmdadm.git mdadm/grow: correct the s->size > 1 to make 'max' work s->size > 1 : s->size is '1' when '--grow --size max' parameter is specified, so correct this test here. Fixes: 1b21c449e6f2 ("mdadm/grow: adding a test to ensure resize was required") Signed-off-by: Zhilong Liu Signed-off-by: Jes Sorensen --- diff --git a/Grow.c b/Grow.c index 80176e32..3ee015b7 100644 --- a/Grow.c +++ b/Grow.c @@ -1815,7 +1815,7 @@ int Grow_reshape(char *devname, int fd, return 1; } - if (array.level > 1 && s->size > 0 && + if (array.level > 1 && s->size > 1 && (array.chunk_size / 1024) > (int)s->size) { pr_err("component size must be larger than chunk size.\n"); return 1;