From 94d31fdaf967f0d224a2bfa7b275b0344e0f5700 Mon Sep 17 00:00:00 2001 From: Csaba Henk Date: Sat, 20 Feb 2010 18:53:38 +0000 Subject: fuse: bring over recent mounting code changes from libfuse upstream Following commits were ported (commit ids as of http://git.gluster.com/?p=users/csaba/fuse.git repo): commit 06fe3eb9c864b69bea98600c0a7eab7b63834735 Author: mszeredi Date: Thu Feb 18 11:05:12 2010 +0000 * Fix stack alignment for clone() ChangeLog | 4 ++++ include/fuse_lowlevel.h | 1 + util/fusermount.c | 9 ++++----- 3 files changed, 9 insertions(+), 5 deletions(-) commit dfe1aab6520d70d72d36edf0508fef9a865daa5f Author: mszeredi Date: Tue Jan 26 18:20:12 2010 +0000 * Fix race if two "fusermount -u" instances are run in parallel. Reported by Dan Rosenberg * Make sure that the path to be unmounted doesn't refer to a symlink ChangeLog | 8 + lib/mount.c | 2 +- lib/mount_util.c | 31 +++-- lib/mount_util.h | 3 +- util/fusermount.c | 380 +++++++++++++++++++++++++++++++++++++++++++++-------- 5 files changed, 351 insertions(+), 73 deletions(-) Signed-off-by: Csaba Henk Signed-off-by: Anand V. Avati BUG: 657 (Metabug for tracking fuse upstream) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=657 --- contrib/fuse-lib/mount.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'contrib/fuse-lib/mount.c') diff --git a/contrib/fuse-lib/mount.c b/contrib/fuse-lib/mount.c index cf8dc5b4a..e88293b38 100644 --- a/contrib/fuse-lib/mount.c +++ b/contrib/fuse-lib/mount.c @@ -351,18 +351,19 @@ fuse_mount_fusermount (const char *mountpoint, const char *opts) static #endif int -fuse_mnt_umount (const char *progname, const char *mnt, int lazy) +fuse_mnt_umount (const char *progname, const char *abs_mnt, + const char *rel_mnt, int lazy) { int res; int status; sigset_t blockmask; sigset_t oldmask; - if (!mtab_needs_update (mnt)) { - res = umount2 (mnt, lazy ? 2 : 0); + if (!mtab_needs_update (abs_mnt)) { + res = umount2 (rel_mnt, lazy ? 2 : 0); if (res == -1) GFFUSE_LOGERR ("%s: failed to unmount %s: %s", - progname, mnt, strerror (errno)); + progname, abs_mnt, strerror (errno)); return res; } @@ -383,7 +384,7 @@ fuse_mnt_umount (const char *progname, const char *mnt, int lazy) if (res == 0) { sigprocmask (SIG_SETMASK, &oldmask, NULL); setuid (geteuid ()); - execl ("/bin/umount", "/bin/umount", "-i", mnt, + execl ("/bin/umount", "/bin/umount", "-i", rel_mnt, lazy ? "-l" : NULL, NULL); GFFUSE_LOGERR ("%s: failed to execute /bin/umount: %s", progname, strerror (errno)); @@ -483,7 +484,7 @@ gf_fuse_unmount (const char *mountpoint, int fd) } if (geteuid () == 0) { - fuse_mnt_umount ("fuse", mountpoint, 1); + fuse_mnt_umount ("fuse", mountpoint, mountpoint, 1); return; } -- cgit