diff options
author | Zhilong Liu <zlliu@suse.com> | 2017-03-01 11:42:33 +0100 |
---|---|---|
committer | Jes Sorensen <Jes.Sorensen@gmail.com> | 2017-03-06 22:28:21 +0100 |
commit | 9d67f6496c71efbc68b33aea663dbcc1597a0828 (patch) | |
tree | c2d2ab60ea2ce7ab3ff49054b96086946d297bac /mdadm.c | |
parent | mdadm:fix typo in comment (diff) | |
download | mdadm-9d67f6496c71efbc68b33aea663dbcc1597a0828.tar.xz mdadm-9d67f6496c71efbc68b33aea663dbcc1597a0828.zip |
mdadm:check the nodes when operate clustered array
It doesn't make sense to write_bitmap with less than 2 nodes,
in order to avoid 'write_bitmap' received invalid nodes number,
it would be better to do checking nodes in getopt operations.
Signed-off-by: Zhilong Liu <zlliu@suse.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
Diffstat (limited to 'mdadm.c')
-rw-r--r-- | mdadm.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -603,8 +603,8 @@ int main(int argc, char *argv[]) case O(GROW, Nodes): case O(CREATE, Nodes): c.nodes = parse_num(optarg); - if (c.nodes <= 0) { - pr_err("invalid number for the number of cluster nodes: %s\n", + if (c.nodes < 2) { + pr_err("clustered array needs two nodes at least: %s\n", optarg); exit(2); } |