]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
mdadm/grow: correct the s->size > 1 to make 'max' work
authorZhilong Liu <zlliu@suse.com>
Thu, 23 Nov 2017 03:10:44 +0000 (11:10 +0800)
committerJes Sorensen <jsorensen@fb.com>
Tue, 28 Nov 2017 16:05:47 +0000 (11:05 -0500)
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 <zlliu@suse.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Grow.c

diff --git a/Grow.c b/Grow.c
index 80176e32c52f62a55da1862dbc26ed4c84b636f1..3ee015b7d20e136c162b765b0f19f96bb1baf552 100644 (file)
--- 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;