diff options
| author | Krishnan Parthasarathi <kparthas@redhat.com> | 2012-10-30 10:23:20 +0530 | 
|---|---|---|
| committer | Vijay Bellur <vbellur@redhat.com> | 2012-11-27 23:28:00 -0800 | 
| commit | cee1b62d013cfb164f2a014919721c920c06514a (patch) | |
| tree | 1ac9ce9b22241a196ccad51b1fb2dc5c857c8bb8 /cli/src | |
| parent | 8fd4aa74149411ab739e2075e1f7c0709b8a0342 (diff) | |
glusterd: volume-sync shouldn't validate volume-id
- volume sync would overwrite volume information on local node
  from the hostname supplied. This warning is provided to the user.
- Also fixed a double free in volume-sync handler.
Change-Id: Icc68d9d563fb50ca58d5880921f063692e1e6882
BUG: 865700
Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-on: http://review.gluster.org/4188
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'cli/src')
| -rw-r--r-- | cli/src/cli-cmd-volume.c | 13 | 
1 files changed, 13 insertions, 0 deletions
diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c index f7586c44c11..f523579a6b2 100644 --- a/cli/src/cli-cmd-volume.c +++ b/cli/src/cli-cmd-volume.c @@ -125,6 +125,11 @@ cli_cmd_sync_volume_cbk (struct cli_state *state, struct cli_cmd_word *word,          int                     parse_error = 0;          dict_t                  *dict = NULL;          cli_local_t             *local = NULL; +        gf_answer_t             answer = GF_ANSWER_NO; +        const char              *question = "Sync volume may make data " +                                            "inaccessible while the sync " +                                            "is in progress. Do you want " +                                            "to continue?";          if ((wordcount < 3) || (wordcount > 4)) {                  cli_usage_out (word->pattern); @@ -159,6 +164,14 @@ cli_cmd_sync_volume_cbk (struct cli_state *state, struct cli_cmd_word *word,                  goto out;          } +        if (!(state->mode & GLUSTER_MODE_SCRIPT)) { +                answer = cli_cmd_get_confirmation (state, question); +                if (GF_ANSWER_NO == answer) { +                        ret = 0; +                        goto out; +                } +        } +          proc = &cli_rpc_prog->proctable[GLUSTER_CLI_SYNC_VOLUME];          frame = create_frame (THIS, THIS->ctx->pool);  | 
