summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c36
1 files changed, 29 insertions, 7 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 545d8bc..7c68947 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -2761,8 +2761,10 @@ void
glusterd_do_volume_quorum_action (xlator_t *this, glusterd_volinfo_t *volinfo,
gf_boolean_t meets_quorum)
{
+ int ret = -1;
glusterd_brickinfo_t *brickinfo = NULL;
glusterd_conf_t *conf = NULL;
+ glusterd_volinfo_t *parent_volinfo = NULL;
conf = this->private;
if (volinfo->status != GLUSTERD_STATUS_STARTED)
@@ -2771,13 +2773,33 @@ glusterd_do_volume_quorum_action (xlator_t *this, glusterd_volinfo_t *volinfo,
if (!glusterd_is_volume_in_server_quorum (volinfo))
meets_quorum = _gf_true;
- list_for_each_entry (brickinfo, &volinfo->bricks, brick_list) {
- if (!glusterd_is_local_brick (this, volinfo, brickinfo))
- continue;
- if (meets_quorum)
- glusterd_brick_start (volinfo, brickinfo, _gf_false);
- else
- glusterd_brick_stop (volinfo, brickinfo, _gf_false);
+ if (volinfo->is_snap_volume == _gf_true) {
+ ret = glusterd_volinfo_find (volinfo->parent_volname, &parent_volinfo);
+ if (ret) {
+ gf_log (THIS->name, GF_LOG_ERROR,
+ "Unable to find parent volume %s for snap %s",
+ volinfo->parent_volname, volinfo->volname);
+ goto out;
+ }
+ list_for_each_entry (brickinfo, &volinfo->bricks, brick_list) {
+ if (!glusterd_is_local_brick (this, volinfo, brickinfo))
+ continue;
+ if (meets_quorum)
+ glusterd_snap_brick_start (parent_volinfo, volinfo,
+ brickinfo, _gf_false);
+ else
+ glusterd_snap_brick_stop (parent_volinfo, volinfo,
+ brickinfo, _gf_false);
+ }
+ } else {
+ list_for_each_entry (brickinfo, &volinfo->bricks, brick_list) {
+ if (!glusterd_is_local_brick (this, volinfo, brickinfo))
+ continue;
+ if (meets_quorum)
+ glusterd_brick_start (volinfo, brickinfo, _gf_false);
+ else
+ glusterd_brick_stop (volinfo, brickinfo, _gf_false);
+ }
}
out:
return;