diff options
author | Vijaikumar M <vmallika@redhat.com> | 2014-05-20 12:25:47 +0530 |
---|---|---|
committer | Krishnan Parthasarathi <kparthas@redhat.com> | 2014-05-29 23:58:45 -0700 |
commit | ac43be9d9c1925a5fddf21ba2061f414e53140a8 (patch) | |
tree | 17c1fa8b493bafc9922e987eb437ef5d270435e4 /xlators/mgmt/glusterd/src/glusterd-utils.c | |
parent | 748175e35e9d2d2506a875bafd6b63889512b7e5 (diff) |
glusterd/snapshot: Use external umount for un-mounting snapshot
umount2 doesn't cleanup /etc/mtab entry after doing umount,
so use external umount command for un-mount operation.
Change-Id: I1a91a700433e2bf15dd21e6fcdd9da54441048d1
BUG: 1098084
Signed-off-by: Vijaikumar M <vmallika@redhat.com>
Reviewed-on: http://review.gluster.org/7775
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 618e8d1dbe0..ced41fb3a55 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -11944,6 +11944,31 @@ out: } int32_t +glusterd_umount (const char *path) +{ + char msg[NAME_MAX] = ""; + int32_t ret = -1; + runner_t runner = {0, }; + xlator_t *this = NULL; + + this = THIS; + GF_ASSERT (this); + GF_ASSERT (path); + + runinit (&runner); + snprintf (msg, sizeof (msg), "umount path %s", path); + runner_add_args (&runner, "umount", "-f", path, NULL); + runner_log (&runner, this->name, GF_LOG_DEBUG, msg); + ret = runner_run (&runner); + if (ret) + gf_log (this->name, GF_LOG_ERROR, "umounting %s failed (%s)", + path, strerror (errno)); + + gf_log (this->name, GF_LOG_TRACE, "Returning with %d", ret); + return ret; +} + +int32_t glusterd_copy_file (const char *source, const char *destination) { int32_t ret = -1; |