From b283a09b05606b953339ea419d16cb1ec40326c3 Mon Sep 17 00:00:00 2001 From: Kaushal M Date: Mon, 2 Apr 2012 11:08:24 +0530 Subject: 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 Reviewed-on: http://review.gluster.com/3059 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- cli/src/cli-cmd-parser.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'cli') 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) -- cgit