From fdf5c159abafd156f47a6c0bd3e7c955b005b285 Mon Sep 17 00:00:00 2001 From: Mohammed Rafi KC Date: Thu, 10 Sep 2015 11:27:42 +0530 Subject: tier/glusterd : Disable subvol match check during detach tier For tiering, user does not have authorization to choose for bricks to detach, so we don't need to whether subvols match for the bricks or not. Back port of >> >Change-Id: I7e777ccc1aa261f652f9b158718fcd55185c7794 >BUG: 1261741 >Signed-off-by: Mohammed Rafi KC >Reviewed-on: http://review.gluster.org/12145 >Reviewed-by: Dan Lambright >Tested-by: NetBSD Build System >Tested-by: Gluster Build System >Reviewed-by: Atin Mukherjee (cherry picked from commit 2e041639d8e49e2b768dd43c6f702106250e4da9) Change-Id: I0819caceb3aad88e242cf62faab471fafd62c63f BUG: 1261742 Signed-off-by: Mohammed Rafi KC Reviewed-on: http://review.gluster.org/12173 Tested-by: NetBSD Build System Tested-by: Gluster Build System Reviewed-by: Dan Lambright Tested-by: Dan Lambright --- xlators/mgmt/glusterd/src/glusterd-brick-ops.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c index 834be85fb36..08bda17acfa 100644 --- a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c @@ -995,8 +995,10 @@ __glusterd_handle_remove_brick (rpcsvc_request_t *req) strcpy (brick_list, " "); + /* subvol match is not required for tiered volume*/ if ((volinfo->type != GF_CLUSTER_TYPE_NONE) && - (volinfo->subvol_count > 1)) { + (volinfo->type != GF_CLUSTER_TYPE_TIER) && + (volinfo->subvol_count > 1)) { ret = subvol_matcher_init (&subvols, volinfo->subvol_count); if (ret) goto out; @@ -1036,13 +1038,19 @@ __glusterd_handle_remove_brick (rpcsvc_request_t *req) (volinfo->brick_count <= volinfo->dist_leaf_count)) continue; - /* Find which subvolume the brick belongs to */ - subvol_matcher_update (subvols, volinfo, brickinfo); + /* Find which subvolume the brick belongs to. + * subvol match is not required for tiered volume + * + */ + if (volinfo->type != GF_CLUSTER_TYPE_TIER) + subvol_matcher_update (subvols, volinfo, brickinfo); } /* Check if the bricks belong to the same subvolumes.*/ - if ((volinfo->type != GF_CLUSTER_TYPE_NONE) && - (volinfo->subvol_count > 1)) { + /* subvol match is not required for tiered volume*/ + if ((volinfo->type != GF_CLUSTER_TYPE_NONE) && + (volinfo->type != GF_CLUSTER_TYPE_TIER) && + (volinfo->subvol_count > 1)) { ret = subvol_matcher_verify (subvols, volinfo, err_str, sizeof(err_str), vol_type, replica_count); -- cgit