diff options
author | Venky Shankar <vshankar@redhat.com> | 2013-07-30 16:18:02 +0530 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2013-09-04 19:35:00 -0700 |
commit | 1a642df1e963bf13d44de5b28a72ed2eb4dbca88 (patch) | |
tree | 8670f25aab72aa37f1fcdc2ba3b18b3561ca4dba /xlators/mgmt/glusterd/src/glusterd-geo-rep.c | |
parent | 81d32caa26ef0e3db10cae53e6820927fe0569fc (diff) |
glusterd: Added op-version checks to geo-rep commands.
Added op-version checks to all geo-rep commands. Min
op-version should be 2.
Change-Id: I942d897404e11e4d53123409731ba5cd252668fe
BUG: 847839
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Signed-off-by: Venky Shankar <vshankar@redhat.com>
Reviewed-on: http://review.gluster.org/5732
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-geo-rep.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-geo-rep.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c index debee9ea694..745bc282ce8 100644 --- a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c +++ b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c @@ -1391,6 +1391,22 @@ glusterd_op_stage_sys_exec (dict_t *dict, char **op_errstr) char command_path[PATH_MAX] = ""; struct stat st = {0,}; int ret = -1; + glusterd_conf_t *conf = NULL; + xlator_t *this = NULL; + + this = THIS; + GF_ASSERT (this); + conf = this->private; + GF_ASSERT (conf); + + if (conf->op_version < 2) { + gf_log ("", GF_LOG_ERROR, "Op Version not supported."); + snprintf (errmsg, sizeof(errmsg), "One or more nodes do not" + " support the required op version."); + *op_errstr = gf_strdup (errmsg); + ret = -1; + goto out; + } ret = dict_get_str (dict, "command", &command); if (ret) { @@ -1449,6 +1465,15 @@ glusterd_op_stage_copy_file (dict_t *dict, char **op_errstr) goto out; } + if (priv->op_version < 2) { + gf_log ("", GF_LOG_ERROR, "Op Version not supported."); + snprintf (errmsg, sizeof(errmsg), "One or more nodes do not" + " support the required op version."); + *op_errstr = gf_strdup (errmsg); + ret = -1; + goto out; + } + ret = dict_get_str (dict, "host-uuid", &host_uuid); if (ret < 0) { gf_log ("", GF_LOG_ERROR, "Unable to fetch" @@ -1785,6 +1810,15 @@ glusterd_op_stage_gsync_create (dict_t *dict, char **op_errstr) return -1; } + if (conf->op_version < 2) { + gf_log ("", GF_LOG_ERROR, "Op Version not supported."); + snprintf (errmsg, sizeof(errmsg), "One or more nodes do not" + " support the required op version."); + *op_errstr = gf_strdup (errmsg); + ret = -1; + goto out; + } + exists = glusterd_check_volume_exists (volname); ret = glusterd_volinfo_find (volname, &volinfo); if ((ret) || (!exists)) { @@ -2008,6 +2042,15 @@ glusterd_op_stage_gsync_set (dict_t *dict, char **op_errstr) if (ret) goto out; + if (conf->op_version < 2) { + gf_log ("", GF_LOG_ERROR, "Op Version not supported."); + snprintf (errmsg, sizeof(errmsg), "One or more nodes do not" + " support the required op version."); + *op_errstr = gf_strdup (errmsg); + ret = -1; + goto out; + } + exists = glusterd_check_volume_exists (volname); ret = glusterd_volinfo_find (volname, &volinfo); if ((ret) || (!exists)) { |