summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaushal M <kaushal@redhat.com>2012-04-02 11:08:24 +0530
committerVijay Bellur <vijay@gluster.com>2012-04-02 11:31:21 -0700
commitb283a09b05606b953339ea419d16cb1ec40326c3 (patch)
tree32b066437e6d492d23e481cc4a122bff899c4375
parent7bcf48a73f6313a0cffbc37288041f1dc8bba71e (diff)
cli: Limit value of bs * count in "volume top"
The maximum value of bs * count is limited to 10GB. This prevents gluster from returning 0 throughput with large values of bs * count. If throughput for values larger than 10GB is required, use dd. Change-Id: Ia4ea70cb20f3f32b6cb81fd451ad56933f438452 BUG: 803322 Signed-off-by: Kaushal M <kaushal@redhat.com> Reviewed-on: http://review.gluster.com/3059 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
-rw-r--r--cli/src/cli-cmd-parser.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c
index ba9ca63d849..6c2cff39641 100644
--- a/cli/src/cli-cmd-parser.c
+++ b/cli/src/cli-cmd-parser.c
@@ -1801,9 +1801,17 @@ cli_cmd_volume_top_parse (const char **words, int wordcount,
}
if ((blk_size > 0) ^ (count > 0)) {
+ cli_out ("Need to give both 'bs' and 'count'");
+ ret = -1;
+ goto out;
+ } else if (((uint64_t)blk_size * count) > (10 * GF_UNIT_GB)) {
+ cli_out ("'bs * count' value %"PRIu64" is greater than "
+ "maximum allowed value of 10GB",
+ ((uint64_t)blk_size * count));
ret = -1;
goto out;
}
+
*options = dict;
out:
if (ret && dict)