diff options
author | Zhilong Liu <zlliu@suse.com> | 2017-09-05 11:41:36 +0200 |
---|---|---|
committer | Jes Sorensen <jsorensen@fb.com> | 2017-10-02 21:59:24 +0200 |
commit | 4b74a905a67e0587ffa6f75d76eb8112e6aa8eed (patch) | |
tree | edfd749be116892e9e54d174ac010b8a7eff8b60 /Grow.c | |
parent | Monitor: Check redundancy for arrays (diff) | |
download | mdadm-4b74a905a67e0587ffa6f75d76eb8112e6aa8eed.tar.xz mdadm-4b74a905a67e0587ffa6f75d76eb8112e6aa8eed.zip |
mdadm/grow: Component size must be larger than chunk size
Grow: Changing component size must be larger than current
chunk size against stripe raids, otherwise Grow_reshape()
would set s->size to '0'.
Signed-off-by: Zhilong Liu <zlliu@suse.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Diffstat (limited to 'Grow.c')
-rw-r--r-- | Grow.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -1816,6 +1816,12 @@ int Grow_reshape(char *devname, int fd, return 1; } + if (array.level > 1 && + (array.chunk_size / 1024) > (int)s->size) { + pr_err("component size must be larger than chunk size.\n"); + return 1; + } + st = super_by_fd(fd, &subarray); if (!st) { pr_err("Unable to determine metadata format for %s\n", devname); |