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 /xlators/mgmt/glusterd/src/glusterd-op-sm.c | |
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 'xlators/mgmt/glusterd/src/glusterd-op-sm.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-op-sm.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index d5686bbab28..4ca70516163 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -785,9 +785,6 @@ glusterd_op_stage_sync_volume (dict_t *dict, char **op_errstr) if (ret) goto out; - ret = glusterd_validate_volume_id (dict, volinfo); - if (ret) - goto out; } else { ret = 0; } @@ -2240,6 +2237,7 @@ glusterd_op_build_payload (dict_t **req, char **op_errstr, dict_t *op_ctx) { int ret = -1; void *ctx = NULL; + dict_t *dict = NULL; dict_t *req_dict = NULL; glusterd_op_t op = GD_OP_NONE; char *volname = NULL; @@ -2271,10 +2269,10 @@ glusterd_op_build_payload (dict_t **req, char **op_errstr, dict_t *op_ctx) } #undef GD_SYNC_OPCODE_KEY + dict = ctx; switch (op) { case GD_OP_CREATE_VOLUME: { - dict_t *dict = ctx; ++glusterfs_port; ret = dict_set_int32 (dict, "port", glusterfs_port); @@ -2286,7 +2284,6 @@ glusterd_op_build_payload (dict_t **req, char **op_errstr, dict_t *op_ctx) case GD_OP_GSYNC_SET: { - dict_t *dict = ctx; ret = glusterd_op_gsync_args_get (dict, &errstr, &volname, @@ -2303,7 +2300,6 @@ glusterd_op_build_payload (dict_t **req, char **op_errstr, dict_t *op_ctx) case GD_OP_SET_VOLUME: { - dict_t *dict = ctx; ret = dict_get_str (dict, "volname", &volname); if (ret) { gf_log (THIS->name, GF_LOG_CRITICAL, @@ -2323,9 +2319,14 @@ glusterd_op_build_payload (dict_t **req, char **op_errstr, dict_t *op_ctx) } break; + case GD_OP_SYNC_VOLUME: + { + dict_copy (dict, req_dict); + break; + } + case GD_OP_STATUS_VOLUME: { - dict_t *dict = ctx; ret = dict_get_uint32 (dict, "cmd", &status_cmd); if (ret) { @@ -2339,7 +2340,7 @@ glusterd_op_build_payload (dict_t **req, char **op_errstr, dict_t *op_ctx) break; } } - + /*fall-through*/ case GD_OP_DELETE_VOLUME: case GD_OP_START_VOLUME: case GD_OP_STOP_VOLUME: @@ -2348,7 +2349,6 @@ glusterd_op_build_payload (dict_t **req, char **op_errstr, dict_t *op_ctx) case GD_OP_RESET_VOLUME: case GD_OP_REMOVE_BRICK: case GD_OP_LOG_ROTATE: - case GD_OP_SYNC_VOLUME: case GD_OP_QUOTA: case GD_OP_PROFILE_VOLUME: case GD_OP_REBALANCE: @@ -2357,7 +2357,6 @@ glusterd_op_build_payload (dict_t **req, char **op_errstr, dict_t *op_ctx) case GD_OP_CLEARLOCKS_VOLUME: case GD_OP_DEFRAG_BRICK_VOLUME: { - dict_t *dict = ctx; ret = dict_get_str (dict, "volname", &volname); if (ret) { gf_log (THIS->name, GF_LOG_CRITICAL, |