From c11e3232963d28b4cdf73b694d82f7b6ed38894f Mon Sep 17 00:00:00 2001 From: Avra Sengupta Date: Thu, 15 Oct 2015 16:08:03 +0530 Subject: snapshot: Fix snapshot clone postvalidate BackPort Of http://review.gluster.org/#/c/12364/ In glusterd_snapshot_clone_postvalidate(), we were deleting snap object and snap vol, by looking up snapname. Hence, it was deleting the orignal snapshot from which the clone was being created Instead it should fetch the clonename, the respective clone vol, and its corresponding snap object, and delete them. Also glusterd_snap_remove(), needs to differentiate a clone snap object from a snaphsot snap object, as in case of a clone snap object, we don't have any persisted data in /var/run/gluster/snaps/ and hence is shouldn't try to delete anything there. Change-Id: I02bb22a3898d5720e318a02d6cc32d25f75d317d BUG: 1271627 Signed-off-by: Avra Sengupta Reviewed-on: http://review.gluster.org/12364 Tested-by: NetBSD Build System Tested-by: Gluster Build System Reviewed-by: mohammed rafi kc Reviewed-by: Rajesh Joseph (cherry picked from commit 59401a32de51cdb6c1a5a1208723e89e1a4abd30) Reviewed-on: http://review.gluster.org/12406 --- xlators/mgmt/glusterd/src/glusterd-store.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-store.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c index 0b947287e97..28f3cf994ed 100644 --- a/xlators/mgmt/glusterd/src/glusterd-store.c +++ b/xlators/mgmt/glusterd/src/glusterd-store.c @@ -4200,7 +4200,8 @@ glusterd_snap_cleanup (xlator_t *this) } } else if (snap->snap_status != GD_SNAP_STATUS_IN_USE) { ret = glusterd_snap_remove (dict, snap, - _gf_true, _gf_true); + _gf_true, _gf_true, + _gf_false); if (ret) { gf_msg (this->name, GF_LOG_ERROR, 0, GD_MSG_SNAP_REMOVE_FAIL, -- cgit