From 6ddb67c8f53bdfc5fb0ca2427b6f1a0112c49ecc Mon Sep 17 00:00:00 2001 From: Rajesh Joseph Date: Fri, 20 Jun 2014 20:01:59 +0530 Subject: 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 Reviewed-on: http://review.gluster.org/8138 Reviewed-by: Niels de Vos Tested-by: Gluster Build System Reviewed-by: Pranith Kumar Karampuri Reviewed-by: Krishnan Parthasarathi Tested-by: Krishnan Parthasarathi --- xlators/mgmt/glusterd/src/glusterd-snapshot.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (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 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; } -- cgit