From cee1b62d013cfb164f2a014919721c920c06514a Mon Sep 17 00:00:00 2001 From: Krishnan Parthasarathi Date: Tue, 30 Oct 2012 10:23:20 +0530 Subject: 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 Reviewed-on: http://review.gluster.org/4188 Reviewed-by: Vijay Bellur Tested-by: Gluster Build System --- cli/src/cli-cmd-volume.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'cli') diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c index f7586c44c..f523579a6 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); -- cgit