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
This commit is contained in:
Csaba Henk 2009-12-24 06:59:44 +00:00 committed by Anand V. Avati
parent ea1403d8d9
commit 013850c9be

View File

@ -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 ());