From 49b796949c9a3cc9d5a541503e03589fb7bcbde2 Mon Sep 17 00:00:00 2001 From: shishir gowda Date: Fri, 15 Apr 2011 07:56:47 +0000 Subject: TOP: validate bs/count pair for write/read-perf measurement If either one the above args are supplied, the other arg should be supplied too. Signed-off-by: shishir gowda Signed-off-by: Anand Avati BUG: 2771 (bs or count tag missing with volume top write-perf/read-perf command blocks glusterd) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2771 --- cli/src/cli-cmd-parser.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cli') diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c index aead5f427..1449d62fa 100644 --- a/cli/src/cli-cmd-parser.c +++ b/cli/src/cli-cmd-parser.c @@ -1475,6 +1475,10 @@ cli_cmd_volume_top_parse (const char **words, int wordcount, goto out; } + if ((blk_size > 0) ^ (count > 0)) { + ret = -1; + goto out; + } *options = dict; out: if (ret && dict) -- cgit