summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-replace-brick.c
diff options
context:
space:
mode:
authorMohammed Rafi KC <rkavunga@redhat.com>2015-04-23 16:24:43 +0530
committerKrishnan Parthasarathi <kparthas@redhat.com>2015-05-28 00:30:34 -0700
commitd6effb1fb232266863eaee5d66c903b0eb623a1a (patch)
tree07c8d1eb1070bba5d5210dca7c79249215e16674 /xlators/mgmt/glusterd/src/glusterd-replace-brick.c
parent4e2bc057ee5afb412d9056dc71a6bb959fb11df6 (diff)
tiering: Do not allow some operations on tiered volume
Back port of http://review.gluster.org/10349 Some operations like add-brick,remove-brick,rebalance, replace-brick are not supported on tiered volume. But there is no code level check for this. This patch will allow to do the same >Change-Id: I12689f4e902cf0cceaf6f7f29c71057305024977 >BUG: 1205624 >Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> >Reviewed-on: http://review.gluster.org/10349 >Tested-by: Gluster Build System <jenkins@build.gluster.com> >Tested-by: NetBSD Build System >Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> >Tested-by: Krishnan Parthasarathi <kparthas@redhat.com> Change-Id: Idaf5469d24f03e79ffb4e4edcbe39e84585aca39 BUG: 1221476 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: http://review.gluster.org/10774 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Dan Lambright <dlambrig@redhat.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-replace-brick.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-replace-brick.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-replace-brick.c b/xlators/mgmt/glusterd/src/glusterd-replace-brick.c
index 818b58a724f..cb9c67cc7dc 100644
--- a/xlators/mgmt/glusterd/src/glusterd-replace-brick.c
+++ b/xlators/mgmt/glusterd/src/glusterd-replace-brick.c
@@ -243,6 +243,14 @@ glusterd_op_stage_replace_brick (dict_t *dict, char **op_errstr,
goto out;
}
+ ret = glusterd_disallow_op_for_tier (volinfo, GD_OP_REPLACE_BRICK, -1);
+ if (ret) {
+ snprintf (msg, sizeof (msg), "Replace brick commands are not "
+ "supported on tiered volume %s", volname);
+ *op_errstr = gf_strdup (msg);
+ goto out;
+ }
+
if (!glusterd_store_is_valid_brickpath (volname, dst_brick) ||
!glusterd_is_valid_volfpath (volname, dst_brick)) {
snprintf (msg, sizeof (msg), "brick path %s is too "