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.
Cleanup of mount doesn't work the way it was envisioned, because the
kernel doesn't follow mounts on the umount() call, hence it will find
a non-mounted directory.
Miklos Szeredi [Wed, 2 Feb 2011 11:18:38 +0000 (12:18 +0100)]
libfuse: fuse_session_loop_mt() shouldn't pause when exiting worker threads
In fuse_session_loop_mt() don't pause when exiting the worker threads.
The pause() was added in 2.2.1 to prevent segfault on pthread_cancel()
on an exited, detached thread. Now worker threads are not detached
and pthread_cancel() should work fine even after the thread exited.
Reported by Boris Protopopov
Miklos Szeredi [Wed, 10 Nov 2010 10:45:50 +0000 (11:45 +0100)]
fusexmp_fh: add read_buf and write_buf implementations
In fusexmp_fh implement the ->read_buf() and ->write_buf() methods.
Leave the ->read() and ->write() implementations for reference, even
though they are not necessary.
Miklos Szeredi [Wed, 10 Nov 2010 10:41:21 +0000 (11:41 +0100)]
fuse_buf_copy: check if buffers are the same
When copying fuse buffers, check if the source and destination are the
same and omit the copy as appropriate. Also check if the source and
destination memory regions overlap and use memmove in that case.
Miklos Szeredi [Wed, 10 Nov 2010 10:41:21 +0000 (11:41 +0100)]
store fuse_buf inside fuse_bufvec
Store the first fuse_buf inside fuse_bufvec. This makes
initialization of fuse_bufvec simpler for the common case of a single
fuse_buf. If multiple fuse_buf's are needed then fuse_bufvec needs to
be dynamically allocated.
Miklos Szeredi [Mon, 8 Nov 2010 16:11:46 +0000 (17:11 +0100)]
libfuse: support zero copy writes in lowlevel interface
Add new ->write_buf() method to low level interface. This
allows passig a generic buffer, either containing a memory buffer
or a file descriptor. This allows implementing zero copy writes.
Add fuse_session_receive_buf() and fuse_session_process_buf()
which may be used in event loop implementations to replace
fuse_chan_recv() and fuse_session_process() respectively.
Miklos Szeredi [Mon, 8 Nov 2010 15:00:16 +0000 (16:00 +0100)]
update umount procedure
If umount(8) supports --fake and --no-canonicalize (util-linux-ng
version 2.18 or later), and umount(2) supports the UMOUNT_NOFOLLOW
flag (linux kernel version 2.6.35 or later) then, "fusermount -u" will
call the umount(2) system call and use "umount --fake ..." to update
/etc/mtab
Added --disable-legacy-umount option to configure. This disables the
runtime checking of umount(8) version. When built with this option
then "fusermount -u" will fail if umount(8) doesn't support the --fake
and --no-canonicalize options.
Add missing argument check in ulockmgr.c to prevent calling
ulockmgr_server with illegal arguments. This would cause an ever growing
list of ulockmgr_server processes with an endless list of open files which
finally exceeds the open file handle limit.
It appears samba is sometimes calling flock with illegal / weired values.
If the "fsname=" option contained a comma then the option parser in
fusermount was confused (Novell bugzilla #641480). Fix by escaping
commas when passing them over to fusermount.
Miklos Szeredi [Fri, 27 Aug 2010 15:16:54 +0000 (17:16 +0200)]
Add NetBSD support
The bulk of it is just about adding ifdef __NetBSD__ where there is
already an ifdef __FreeBSD__
Add a arch=netbsd to deal with NetBSD specifics. I suggests that
arch=bsd could be renamed to arch=freebsd
NetBSD specific linking with -lperfuse
NetBSD patches to lib/mount.c. It turned to be less itrusive to patch
mount;c than mount_bsd.c. I suggest mount_bsd.c could be renamed to
mount_freebsd.c
Add a generic buffer interface for use with I/O. Buffer vectors are
supplied and each buffer in the vector may be a memory pointer or a
file descriptor.
The fuse_reply_fd() interface is converted to using buffers.
Miklos Szeredi [Tue, 15 Jun 2010 17:55:37 +0000 (17:55 +0000)]
* Add a nopath option and flag, indicating that path argument
need not be calculated for the following operations: read, write,
flush, release, fsync, readdir, releasedir, fsyncdir, ftruncate,
fgetattr, lock, ioctl and poll.