summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorCsaba Henk <csaba@gluster.com>2009-12-24 06:59:44 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-12-28 04:39:31 -0800
commit013850c9bedacdb868eee6b70f3aa6b46d4acfab (patch)
treeb9b0d3d1e6df68d2430ec793d8b4725d88f04e21 /contrib
parentea1403d8d922c3f08dc6feecc17d6eb33b8a72d2 (diff)
fuse: add mtab entry asynchronously
Instead of taking libfuse's approach to the bug referred -- making use of an ad-hoc mount option --, we get over the issue by not waiting for mtab manipulation to complete. If mtab manipulation happens to fail for some reason, just log an error message (instead of aborting the mount). Signed-off-by: Csaba Henk <csaba@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 511 (mount hangs with some audit configurations) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=511
Diffstat (limited to 'contrib')
-rw-r--r--contrib/fuse-lib/mount.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/contrib/fuse-lib/mount.c b/contrib/fuse-lib/mount.c
index 0a39e24c2..cf8dc5b4a 100644
--- a/contrib/fuse-lib/mount.c
+++ b/contrib/fuse-lib/mount.c
@@ -125,6 +125,21 @@ fuse_mnt_add_mount (const char *progname, const char *fsname,
char templ[] = "/tmp/fusermountXXXXXX";
char *tmp;
+ /* mtab update done async, just log if fails */
+ res = fork ();
+ if (res)
+ exit (res == -1 ? 1 : 0);
+ res = fork ();
+ if (res) {
+ if (res != -1)
+ res = waitpid (res, &status, 0);
+ if (res == -1)
+ GFFUSE_LOGERR ("%s: /etc/mtab update failed",
+ progname);
+
+ exit (0);
+ }
+
sigprocmask (SIG_SETMASK, &oldmask, NULL);
setuid (geteuid ());