7f4c2a
From db45f6f3cf571a518788e451f758c59249da949a Mon Sep 17 00:00:00 2001
7f4c2a
From: Manikandan Selvaganesh <mselvaga@redhat.com>
7f4c2a
Date: Tue, 7 Jul 2015 18:37:42 +0530
7f4c2a
Subject: [PATCH 261/279] quota : validating soft limit percentage
7f4c2a
7f4c2a
> Reviewed-on: http://review.gluster.org/11566
7f4c2a
> Tested-by: NetBSD Build System <jenkins@build.gluster.org>
7f4c2a
> Tested-by: Gluster Build System <jenkins@build.gluster.com>
7f4c2a
> Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com>
7f4c2a
> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
7f4c2a
7f4c2a
Change-Id: I14c049c84c468b6415a1de45441b2fed94e8ed4b
7f4c2a
BUG: 1064265
7f4c2a
Signed-off-by: Manikandan Selvaganesh <mselvaga@redhat.com>
7f4c2a
Reviewed-on: https://code.engineering.redhat.com/gerrit/55071
7f4c2a
Reviewed-by: Raghavendra Gowdappa <rgowdapp@redhat.com>
7f4c2a
Tested-by: Raghavendra Gowdappa <rgowdapp@redhat.com>
7f4c2a
---
7f4c2a
 cli/src/cli-cmd-parser.c |    6 ++++--
7f4c2a
 1 files changed, 4 insertions(+), 2 deletions(-)
7f4c2a
7f4c2a
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c
7f4c2a
index 51da792..8f3396f 100644
7f4c2a
--- a/cli/src/cli-cmd-parser.c
7f4c2a
+++ b/cli/src/cli-cmd-parser.c
7f4c2a
@@ -1116,8 +1116,10 @@ cli_cmd_quota_parse (const char **words, int wordcount, dict_t **options)
7f4c2a
                 if (wordcount == 7) {
7f4c2a
 
7f4c2a
                         ret = gf_string2percent (words[6], &percent);
7f4c2a
-                        if (ret != 0) {
7f4c2a
-                                cli_err ("Please enter a correct value");
7f4c2a
+                        if (ret != 0 || percent > 100) {
7f4c2a
+                                ret = -1;
7f4c2a
+                                cli_err ("Please enter a correct value "
7f4c2a
+                                         "in the range of 0 to 100");
7f4c2a
                                 goto out;
7f4c2a
                         }
7f4c2a
 
7f4c2a
-- 
7f4c2a
1.7.1
7f4c2a