summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMohammed Rafi KC <rkavunga@redhat.com>2015-06-04 14:14:14 +0530
committerAtin Mukherjee <amukherj@redhat.com>2015-06-16 22:10:55 -0700
commitbf6a71bcb08357766027e9318edae4b8298c339c (patch)
treeaae8478619f3c8738dd4e3a8e5bf9345cd83d9f8
parent6d1898116c45dee33a8a2b7f409445a12c633780 (diff)
glusterd/tier: glusterd crashed with detach-tier commit force
glusterd crashed when doing "detach-tier commit force" on a non-tiered volume. >Change-Id: I884771893bb80bec46ae8642c2cfd7e54ab116a6 >BUG: 1228112 >Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> >Reviewed-on: http://review.gluster.org/11081 >Tested-by: Gluster Build System <jenkins@build.gluster.com> >Tested-by: NetBSD Build System <jenkins@build.gluster.org> >Reviewed-by: Joseph Fernandes >Reviewed-by: Dan Lambright <dlambrig@redhat.com> >Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> (cherry picked from commit fefc8730e2a87db41d5f79c9853a14cab86715e5) Change-Id: Ia536da3ec4c632d7d1cc1575dd2b7b098a2c7aec BUG: 1230563 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: http://review.gluster.org/11174 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Joseph Fernandes Tested-by: Joseph Fernandes
-rw-r--r--cli/src/cli-rpc-ops.c2
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-brick-ops.c7
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-rebalance.c9
3 files changed, 16 insertions, 2 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c
index 290028f6510..a834147bb62 100644
--- a/cli/src/cli-rpc-ops.c
+++ b/cli/src/cli-rpc-ops.c
@@ -1784,7 +1784,7 @@ gf_cli_defrag_volume_cbk (struct rpc_req *req, struct iovec *iov,
rsp.op_errstr);
}
}
- if (cmd == GF_DEFRAG_CMD_STATUS) {
+ if (cmd == GF_DEFRAG_CMD_STATUS || cmd == GF_DEFRAG_CMD_STATUS_TIER) {
if (rsp.op_ret == -1) {
if (strcmp (rsp.op_errstr, ""))
snprintf (msg, sizeof (msg),
diff --git a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
index b0cd2c1d890..3a9d3188278 100644
--- a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
+++ b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
@@ -1810,6 +1810,13 @@ glusterd_op_stage_remove_brick (dict_t *dict, char **op_errstr)
break;
case GF_OP_CMD_DETACH_COMMIT_FORCE:
+ if (volinfo->type != GF_CLUSTER_TYPE_TIER) {
+ snprintf (msg, sizeof(msg), "volume %s is not a tier "
+ "volume", volinfo->volname);
+ errstr = gf_strdup (msg);
+ gf_log (this->name, GF_LOG_ERROR, "%s", errstr);
+ goto out;
+ }
case GF_OP_CMD_COMMIT_FORCE:
break;
}
diff --git a/xlators/mgmt/glusterd/src/glusterd-rebalance.c b/xlators/mgmt/glusterd/src/glusterd-rebalance.c
index 3acb394c4b1..41501d1243f 100644
--- a/xlators/mgmt/glusterd/src/glusterd-rebalance.c
+++ b/xlators/mgmt/glusterd/src/glusterd-rebalance.c
@@ -606,9 +606,15 @@ glusterd_op_stage_rebalance (dict_t *dict, char **op_errstr)
goto out;
}
switch (cmd) {
+ case GF_DEFRAG_CMD_START_TIER:
+ if (volinfo->type != GF_CLUSTER_TYPE_TIER) {
+ gf_asprintf (op_errstr, "volume %s is not a tier "
+ "volume.", volinfo->volname);
+ ret = -1;
+ goto out;
+ }
case GF_DEFRAG_CMD_START:
case GF_DEFRAG_CMD_START_LAYOUT_FIX:
- case GF_DEFRAG_CMD_START_TIER:
/* Check if the connected clients are all of version
* glusterfs-3.6 and higher. This is needed to prevent some data
* loss issues that could occur when older clients are connected
@@ -668,6 +674,7 @@ glusterd_op_stage_rebalance (dict_t *dict, char **op_errstr)
goto out;
}
break;
+ case GF_DEFRAG_CMD_STATUS_TIER:
case GF_DEFRAG_CMD_STATUS:
case GF_DEFRAG_CMD_STOP:
case GF_DEFRAG_CMD_STOP_DETACH_TIER: