From 613f5c0120068a117f7337eeda293512bf106ef8 Mon Sep 17 00:00:00 2001 From: Mohammed Rafi KC Date: Tue, 8 Sep 2015 13:04:45 +0530 Subject: tier/shd: make shd commands compatible with tiering tiering volfiles may contain afr and disperse together or multiple time based on configuration. And the informations for those configurations are stored in tier_info. So most of the volgen code generation need to be changed to make compatible with it. Back port of> >Change-Id: I563d1ca6f281f59090ebd470b7fda1cc4b1b7e1d >BUG: 1261276 >Signed-off-by: Mohammed Rafi KC >Reviewed-on: http://review.gluster.org/12135 >Tested-by: NetBSD Build System >Tested-by: Gluster Build System >Reviewed-by: Pranith Kumar Karampuri (cherry picked from commit 0ef62933649392051e73fe01c028e41baddec489) BUG: 1261744 Change-Id: Iff1b27ae8ce61f1f38fbbd6c92894b3d3516e4d4 Signed-off-by: Mohammed Rafi KC Reviewed-on: http://review.gluster.org/12344 Tested-by: NetBSD Build System Tested-by: Gluster Build System Reviewed-by: Joseph Fernandes Reviewed-by: Dan Lambright Tested-by: Dan Lambright --- xlators/mgmt/glusterd/src/glusterd-volume-set.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'xlators/mgmt/glusterd/src/glusterd-volume-set.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c index 9bc0d577f00..e16fa0f1b06 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c +++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c @@ -390,6 +390,16 @@ validate_disperse_heal_enable_disable (glusterd_volinfo_t *volinfo, char **op_errstr) { int ret = 0; + if (volinfo->type == GF_CLUSTER_TYPE_TIER) { + if (volinfo->tier_info.cold_type != GF_CLUSTER_TYPE_DISPERSE && + volinfo->tier_info.hot_type != GF_CLUSTER_TYPE_DISPERSE) { + gf_asprintf (op_errstr, "Volume %s is not containing " + "disperse type", volinfo->volname); + + return -1; + } else + return 0; + } if (volinfo->type != GF_CLUSTER_TYPE_DISPERSE) { gf_asprintf (op_errstr, "Volume %s is not of disperse type", -- cgit