summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cli/src/cli-cmd-volume.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c
index 3bd54a6fb..f008384ae 100644
--- a/cli/src/cli-cmd-volume.c
+++ b/cli/src/cli-cmd-volume.c
@@ -463,6 +463,7 @@ cli_cmd_volume_defrag_cbk (struct cli_state *state, struct cli_cmd_word *word,
dict_t *dict = NULL;
int sent = 0;
int parse_error = 0;
+ int index = 0;
#ifdef GF_SOLARIS_HOST_OS
cli_out ("Command not supported on Solaris");
goto out;
@@ -482,8 +483,20 @@ cli_cmd_volume_defrag_cbk (struct cli_state *state, struct cli_cmd_word *word,
goto out;
}
- if (strcmp (words[3], "start") && strcmp (words[3], "stop") &&
- strcmp (words[3], "status")) {
+ if (wordcount == 4) {
+ index = 3;
+ } else {
+ if (strcmp (words[3], "fix-layout") &&
+ strcmp (words[3], "migrate-data")) {
+ cli_usage_out (word->pattern);
+ parse_error = 1;
+ goto out;
+ }
+ index = 4;
+ }
+
+ if (strcmp (words[index], "start") && strcmp (words[index], "stop") &&
+ strcmp (words[index], "status")) {
cli_usage_out (word->pattern);
parse_error = 1;
goto out;