From 013850c9bedacdb868eee6b70f3aa6b46d4acfab Mon Sep 17 00:00:00 2001 From: Csaba Henk Date: Thu, 24 Dec 2009 06:59:44 +0000 Subject: 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 Signed-off-by: Anand V. Avati BUG: 511 (mount hangs with some audit configurations) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=511 --- contrib/fuse-lib/mount.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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 ()); -- cgit