summaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
Diffstat (limited to 'cli')
-rw-r--r--cli/src/cli-cmd-parser.c6
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;