diff options
-rw-r--r-- | cli/src/cli-rpc-ops.c | 2 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-brick-ops.c | 7 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-rebalance.c | 9 |
3 files changed, 16 insertions, 2 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index 8aca451fece..1d2480af97a 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -1779,7 +1779,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 d8c34b4bfe7..5c0ed1e304c 100644 --- a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c @@ -1805,6 +1805,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 314372e2037..9f4b42171c5 100644 --- a/xlators/mgmt/glusterd/src/glusterd-rebalance.c +++ b/xlators/mgmt/glusterd/src/glusterd-rebalance.c @@ -592,9 +592,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 @@ -651,6 +657,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: |