summaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
authorManikandan Selvaganesh <mselvaga@redhat.com>2015-07-07 18:37:42 +0530
committerRaghavendra G <rgowdapp@redhat.com>2015-07-20 03:41:48 -0700
commitbc6110fa37f1d6214d2e8cce367e0b7abd6976c3 (patch)
treeb829ba0ae7c3ab98504d51bbff4bf329a9cf8490 /cli
parent0acd0b45e5ee22eb5bb35c21093136b3b062744f (diff)
quota : validating soft limit percentage.
Change-Id: I14c049c84c468b6415a1de45441b2fed94e8ed4b BUG: 1240654 Signed-off-by: Manikandan Selvaganesh <mselvaga@redhat.com> Reviewed-on: http://review.gluster.org/11566 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'cli')
-rw-r--r--cli/src/cli-cmd-parser.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c
index a243a3542e9..6d84fec099c 100644
--- a/cli/src/cli-cmd-parser.c
+++ b/cli/src/cli-cmd-parser.c
@@ -1111,8 +1111,10 @@ cli_cmd_quota_parse (const char **words, int wordcount, dict_t **options)
if (wordcount == 7) {
ret = gf_string2percent (words[6], &percent);
- if (ret != 0) {
- cli_err ("Please enter a correct value");
+ if (ret != 0 || percent > 100) {
+ ret = -1;
+ cli_err ("Please enter a correct value "
+ "in the range of 0 to 100");
goto out;
}