summaryrefslogtreecommitdiffstats
path: root/contrib/fuse-lib
diff options
context:
space:
mode:
authorCsaba Henk <csaba@gluster.com>2010-02-20 18:53:38 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-02-21 00:17:42 -0800
commit94d31fdaf967f0d224a2bfa7b275b0344e0f5700 (patch)
treec1b5134d26aa145d36da5c1b732f3a10ea56422c /contrib/fuse-lib
parentf9269f4776141ae78fb10d1bf5ae63da7595a369 (diff)
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 <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 <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 <csaba@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 657 (Metabug for tracking fuse upstream) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=657
Diffstat (limited to 'contrib/fuse-lib')
-rw-r--r--contrib/fuse-lib/mount.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/contrib/fuse-lib/mount.c b/contrib/fuse-lib/mount.c
index cf8dc5b4afb..e88293b38c7 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;
}