diff options
author | Sunny Kumar <sunkumar@redhat.com> | 2017-11-03 15:30:51 +0530 |
---|---|---|
committer | mohammed rafi kc <rkavunga@redhat.com> | 2017-11-08 05:21:25 +0000 |
commit | 96f6eb508821d20d4cc440de9da47af13ab49413 (patch) | |
tree | 17f382e4b1e8f23f0c8ec919150c699e5615fd76 /xlators/mgmt/glusterd/src | |
parent | ea6b6461f34332cede200cdbcba299f1de69ba12 (diff) |
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 <sunkumar@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-snapshot.c | 20 |
1 files changed, 13 insertions, 7 deletions
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) { |