diff options
author | shishir gowda <shishirng@gluster.com> | 2011-04-15 07:56:47 +0000 |
---|---|---|
committer | Anand Avati <avati@gluster.com> | 2011-04-15 23:33:14 -0700 |
commit | 49b796949c9a3cc9d5a541503e03589fb7bcbde2 (patch) | |
tree | b234857795b54e38df85523fd2c4d49ac078e6c5 /cli | |
parent | baaa7286ed6b70121efa6a83a8adb3a2f1ec45da (diff) |
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 <shishirng@gluster.com>
Signed-off-by: Anand Avati <avati@gluster.com>
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
Diffstat (limited to 'cli')
-rw-r--r-- | cli/src/cli-cmd-parser.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c index aead5f42727..1449d62fa1f 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) |