summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorRajesh Joseph <rjoseph@redhat.com>2014-06-20 20:01:59 +0530
committerKrishnan Parthasarathi <kparthas@redhat.com>2014-06-23 05:39:28 -0700
commit6ddb67c8f53bdfc5fb0ca2427b6f1a0112c49ecc (patch)
treef8506ea25d204abaede1cede24198475fca55fab /xlators
parentbeeb30a4b777c5bbd6ebfd8f2074b99f30122e08 (diff)
glusterd/snapshot: delete temporary folder after snapshot create
snapshot create create temporary folders in /tmp location with the name xfsmountXXXXXX. It should be cleaned up after snapshot create Change-Id: Idd0c480c1eee7f0fdeba92ae427510faac0f5234 BUG: 1111614 Signed-off-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-on: http://review.gluster.org/8138 Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-snapshot.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot.c b/xlators/mgmt/glusterd/src/glusterd-snapshot.c
index 0c5953bcd7f..f2fb2ba5552 100644
--- a/xlators/mgmt/glusterd/src/glusterd-snapshot.c
+++ b/xlators/mgmt/glusterd/src/glusterd-snapshot.c
@@ -4030,7 +4030,8 @@ glusterd_update_fs_uuid (glusterd_brickinfo_t *brickinfo)
mount_path = mkdtemp (template);
if (NULL == mount_path) {
gf_log (this->name, GF_LOG_ERROR, "Failed to create "
- "temporary folder name");
+ "temporary folder. Error: %s",
+ strerror (errno));
runner_end (&runner);
goto out;
}
@@ -4092,6 +4093,13 @@ glusterd_update_fs_uuid (glusterd_brickinfo_t *brickinfo)
ret = 0;
out:
+ if (NULL != mount_path) {
+ if (rmdir (mount_path)) {
+ gf_log (this->name, GF_LOG_ERROR, "Failed to remove "
+ "temporary folder %s. Error: %s",
+ mount_path, strerror (errno));
+ }
+ }
return ret;
}