a3470f
From 164e0384d6ae0ac9be713b4167d2b7151a027dc4 Mon Sep 17 00:00:00 2001
a3470f
From: Sunny Kumar <sunkumar@redhat.com>
a3470f
Date: Tue, 28 Nov 2017 18:48:31 +0530
a3470f
Subject: [PATCH 086/128] snapshot: lvm cleanup during snapshot remove
a3470f
a3470f
Problem : During snapshot remove lvm cleanup was skipped for deactivated
a3470f
          snapshots by assuming that its mount point is not present.
a3470f
a3470f
Fix : Do no skip lvm cleanup by checking active mount point.
a3470f
a3470f
Upstream Patch : https://review.gluster.org/18654
a3470f
a3470f
>BUG: 1509254
a3470f
>Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
a3470f
a3470f
BUG: 1467903
a3470f
Change-Id: I856d2d647c75db8b37b7f430277daef6eb7580a8
a3470f
Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
a3470f
Reviewed-on: https://code.engineering.redhat.com/gerrit/124534
a3470f
Tested-by: RHGS Build Bot <nigelb@redhat.com>
a3470f
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
a3470f
---
a3470f
 xlators/mgmt/glusterd/src/glusterd-snapshot.c | 20 +++++++++++++-------
a3470f
 1 file changed, 13 insertions(+), 7 deletions(-)
a3470f
a3470f
diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot.c b/xlators/mgmt/glusterd/src/glusterd-snapshot.c
a3470f
index 275abe3..5bdf27f 100644
a3470f
--- a/xlators/mgmt/glusterd/src/glusterd-snapshot.c
a3470f
+++ b/xlators/mgmt/glusterd/src/glusterd-snapshot.c
a3470f
@@ -2984,13 +2984,19 @@ glusterd_lvm_snapshot_remove (dict_t *rsp_dict, glusterd_volinfo_t *snap_vol)
a3470f
                         continue;
a3470f
                 }
a3470f
 
a3470f
-                ret = sys_lstat (brick_mount_path, &stbuf);
a3470f
-                if (ret) {
a3470f
-                        gf_msg_debug (this->name, 0,
a3470f
-                                "Brick %s:%s already deleted.",
a3470f
-                                brickinfo->hostname, brickinfo->path);
a3470f
-                        ret = 0;
a3470f
-                        continue;
a3470f
+                /* As deactivated snapshot have no active mount point we
a3470f
+                 * check only for activated snapshot.
a3470f
+                 */
a3470f
+                if (snap_vol->status == GLUSTERD_STATUS_STARTED) {
a3470f
+                        ret = sys_lstat (brick_mount_path, &stbuf);
a3470f
+                        if (ret) {
a3470f
+                                gf_msg_debug (this->name, 0,
a3470f
+                                              "Brick %s:%s already deleted.",
a3470f
+                                              brickinfo->hostname,
a3470f
+                                              brickinfo->path);
a3470f
+                                ret = 0;
a3470f
+                                continue;
a3470f
+                        }
a3470f
                 }
a3470f
 
a3470f
                 if (brickinfo->snap_status == -1) {
a3470f
-- 
a3470f
1.8.3.1
a3470f