From 96f6eb508821d20d4cc440de9da47af13ab49413 Mon Sep 17 00:00:00 2001 From: Sunny Kumar Date: Fri, 3 Nov 2017 15:30:51 +0530 Subject: snapshot: lvm cleanup during snapshot remove Problem : During snapshot remove lvm cleanup was skipped for deactivated snapshots by assuming that its mount point is not present. Fix : Do no skip lvm cleanup by checking active mount point. Change-Id: I856d2d647c75db8b37b7f430277daef6eb7580a8 BUG: 1509254 Signed-off-by: Sunny Kumar --- xlators/mgmt/glusterd/src/glusterd-snapshot.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'xlators/mgmt/glusterd/src') diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot.c b/xlators/mgmt/glusterd/src/glusterd-snapshot.c index e8ba32087f6..f161a6f18b6 100644 --- a/xlators/mgmt/glusterd/src/glusterd-snapshot.c +++ b/xlators/mgmt/glusterd/src/glusterd-snapshot.c @@ -2905,13 +2905,19 @@ glusterd_lvm_snapshot_remove (dict_t *rsp_dict, glusterd_volinfo_t *snap_vol) continue; } - ret = sys_lstat (brick_mount_path, &stbuf); - if (ret) { - gf_msg_debug (this->name, 0, - "Brick %s:%s already deleted.", - brickinfo->hostname, brickinfo->path); - ret = 0; - continue; + /* As deactivated snapshot have no active mount point we + * check only for activated snapshot. + */ + if (snap_vol->status == GLUSTERD_STATUS_STARTED) { + ret = sys_lstat (brick_mount_path, &stbuf); + if (ret) { + gf_msg_debug (this->name, 0, + "Brick %s:%s already deleted.", + brickinfo->hostname, + brickinfo->path); + ret = 0; + continue; + } } if (brickinfo->snap_status == -1) { -- cgit