Miklos Szeredi [Thu, 20 Jun 2013 09:43:02 +0000 (11:43 +0200)]
libfuse: fix multiple close of device fd
- fuse_kern_unmount closes handle (e.g. 19)
- a thread in my process opens a file - the OS assigns newly freed
handle (i.e. 19)
- fuse_kern_chan_destroy closes the same handle (i.e. 19)
- a thread in my process opens another file - the OS assigns newly
freed handle (i.e. 19)
- * MAYHEM *
Miklos Szeredi [Mon, 4 Feb 2013 17:30:14 +0000 (18:30 +0100)]
libfuse: configure: detect new util-linux
Apparently new versions of util-linux umount return with an exit status of 1
even if the "--fake" option is recognised (despite being documented otherwise).
Check this condition and don't complain about util-linux version.
Miklos Szeredi [Fri, 24 Aug 2012 13:13:17 +0000 (15:13 +0200)]
Fix missing config.h in buffer.c
Due to an oversight, splice will never actually be used for i/o. Someone forgot
to #include "config.h" in lib/buffer.c (in fact almost no files include that
header). As a result, even though configure detects splice support and puts
HAVE_SPLICE in config.h, buffer.c is always compiled as if there is no splice
support.
Also add #include "config.h" to fuse.c and fuse_lowlevel.c. These currently
include it indirectly through fuse_misc.h, but we don't want to depend on that.
Miklos Szeredi [Tue, 14 Aug 2012 09:18:07 +0000 (11:18 +0200)]
Fix "fuse internal error: node NNN not found"
Commit 4dc7e675bb (Don't unhash name in FORGET) broke the forget logic in a
subtle way, resulting in "fuse internal error: node NNN not found" and causing
the filesystem daemon to abort.
Fix by incrementing the node refcount if nlookup goes from zero to one.
The failure path of try_get_path2() erronously tried to free the "path1" value
(an address on the stack) instead of the allocated string pointed to by "path1".
This caused the library to crash.
fallocate filesystem operation preallocates media space for the given file.
If fallocate returns success then any subsequent write to the given range
never fails with 'not enough space' error.
Miklos Szeredi [Wed, 16 May 2012 14:45:27 +0000 (16:45 +0200)]
Fix -pthread in fuse.pc
Linking to a library that uses threads requires the application to be linked
with -pthreads otherwise some pthread functions will be linked to stubs in
glibc. So move -pthread from Libs.private to Libs in fuse.pc.
Miklos Szeredi [Fri, 9 Dec 2011 15:07:55 +0000 (16:07 +0100)]
Fix hang in wait_on_path()
Ville Silventoinen reported that fs_racer in LTP triggered a hang in
wait_on_path(). This bug was caused by try_get_path() not resetting "ticket" on
permanent failure.
fusexmp uses utimens and takes that function for granted. It is part of
POSIX exended API set 2 and some systems do not have it yet. Attached
patch checks for utimens availability and returns ENOSYS if unavailable.
John Muir [Tue, 6 Dec 2011 20:56:34 +0000 (21:56 +0100)]
libfuse: Notifying the kernel of deletion.
libfuse part to allow a FUSE file-system to tell the kernel when a
file or directory is deleted. If the specified dentry has the
specified inode number, the kernel will unhash it.
Signed-off-by: John Muir <john@jmuir.com> Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Miklos Szeredi [Thu, 17 Nov 2011 11:36:38 +0000 (12:36 +0100)]
Fix the following compile error
fusermount.c: In function 'clone_newns':
fusermount.c:315:2: warning: implicit declaration of function 'clone' [-Wimplicit-function-declaration]
fusermount.c:315:44: error: 'CLONE_NEWNS' undeclared (first use in this function)
fusermount.c:315:44: note: each undeclared identifier is reported only once for each function it appears in
fusermount.c:317:1: warning: control reaches end of non-void function [-Wreturn-type]
Miklos Szeredi [Sun, 23 Oct 2011 08:07:20 +0000 (10:07 +0200)]
Reply with ENOMEM in case of failure to allocate request
Reply to request with ENOMEM in case of failure to allocate request
structure. Otherwise the task issuing the request will just freeze up
until the filesystem daemon is killed. Reported by Stephan Kulow
Add ->flock() operation to low and high level interfaces
This fixes problems with emulating flock() with POSIX locking.
Reported by Sebastian Pipping.
As with lock/setlk/getlk most filesystems don't need to implement
this, as the kernel takes care of file locking. The only reason to
implement locking operations is for network filesystems which want
file locking to work between clients.
Miklos Szeredi [Thu, 19 May 2011 12:49:26 +0000 (14:49 +0200)]
Disable splice by default
Disable splice by default, add "splice_read", "splice_write" and
"splice_move" options. Keep the "no_splice_*" variants, which can
disable splice even if the filesystem explicitly enables it.
Max Krasnyansky [Sat, 12 Mar 2011 06:59:14 +0000 (22:59 -0800)]
fusermount: Added support for auto_unmount option
When this option is specified fusermount will become a daemon and wait for the
parent to exit or die, which causes control fd to get closed. It will then try
to unmount the original mountpoint.
Max Krasnyansky [Sat, 12 Mar 2011 04:49:18 +0000 (20:49 -0800)]
libfuse: Added support for auto_unmount option
This change adds support for "auto_unmount" option to libfuse.
auto_umount option unmounts the fs automatically on application
termination, whether normal or not (segfault, etc).
When auto_unmount option is specified libfuse will alway use
fusermount for mounting the fs. This change is selfcontained but
for complete functionaly it requires auto_unmount support in
fusermount tool.