diff options
author | Sunil Kumar Acharya <sheggodu@redhat.com> | 2018-10-24 18:11:13 +0530 |
---|---|---|
committer | Sunil Kumar Acharya <sheggodu@redhat.com> | 2018-10-24 18:45:50 +0530 |
commit | e15a5a5cc67fa3323722353bb4ccca0ea41aa594 (patch) | |
tree | 72ac6ff5e96e076ff5321dd585f703666c89f417 /cli/src/cli-cmd-parser.c | |
parent | 87613d265a1a394d785daeed569b384cd74c6574 (diff) |
cluster/ec : Prevent volume create without redundant brick
Problem:
EC volumes can be created without any redundant brick.
Solution:
Updated the conditional check to avoid volume create without
redundant brick.
fixes: bz#1642448
Change-Id: I0cb334b1b9378d67fcb8abf793dbe312c3179c0b
Signed-off-by: Sunil Kumar Acharya <sheggodu@redhat.com>
Diffstat (limited to 'cli/src/cli-cmd-parser.c')
-rw-r--r-- | cli/src/cli-cmd-parser.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c index 4c5497ac206..bbed960efbf 100644 --- a/cli/src/cli-cmd-parser.c +++ b/cli/src/cli-cmd-parser.c @@ -310,10 +310,10 @@ cli_cmd_create_disperse_check(struct cli_state *state, int *disperse, tmp = *disperse - *redundancy; } - if (*redundancy > (*disperse - 1) / 2) { + if ((*redundancy < 1) || (*redundancy > (*disperse - 1) / 2)) { cli_err( - "redundancy must be less than %d for a " - "disperse %d volume", + "redundancy must be greater than or equal to 1 and " + "less than %d for a disperse %d volume", (*disperse + 1) / 2, *disperse); return -1; |