Commit Graph

881 Commits

Author SHA1 Message Date
Laszlo Papp
b812c4c406 Check the return value after an open syscall 2011-03-30 19:34:58 +02:00
Laszlo Papp
b0ceaa0670 Check the negative return value after an open syscall 2011-03-30 19:34:58 +02:00
Miklos Szeredi
d6bec4020f In case of failure to add to /etc/mtab don't umount.
Reported by Marc Deslauriers
2011-03-11 13:51:49 +01:00
Miklos Szeredi
2250aae7bc Revert "Fix cleanup in case of failed mount"
This reverts commit bf5ffb5fd8.

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.
2011-03-11 13:46:13 +01:00
Miklos Szeredi
337a2e4b24 Add -onoforget to help output 2011-02-17 14:22:38 +01:00
Miklos Szeredi
71b1c37a66 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
2011-02-02 12:18:38 +01:00
Miklos Szeredi
cbd3a2a840 fusermount: only allow mount and umount if util-linux suppports --no-canonicalize
Remove "legacy" util-linux support as missing --no-canonicalize cannot
be worked around in fuse.
2011-01-31 16:33:22 +01:00
Miklos Szeredi
1e7607ff89 fusermount: chdir to / before performing mount/umount 2011-01-31 16:33:14 +01:00
Miklos Szeredi
bf5ffb5fd8 Fix cleanup in case of failed mount
In case of failure to add to /etc/mtab use same mountpoint for cleanup
as for mounting.  Reported by Marc Deslauriers
2011-01-31 16:32:46 +01:00
Miklos Szeredi
c958643e37 Fix warning in hash calculation
Fix the following warning:

  fuse.c:436: warning: this decimal constant is unsigned only in ISO C90
2011-01-31 12:18:06 +01:00
Miklos Szeredi
6646f6bed3 Highlevel lib: add slab allocation for node cache
This will allow the memory used by the filesystem to grow and shrink
depending on how many inodes are currently cached.
2010-12-20 18:50:13 +01:00
Miklos Szeredi
8a92fde75d inline short names
In the high level library store names shorter than 32 characters
inside "struct node".  Longer names are allocated as previously.
2010-12-20 18:50:13 +01:00
Miklos Szeredi
94c28cc658 Highlevel lib: allow hash tables to shrink
Allow hash tables to shrink as well as grow.
2010-12-20 18:50:13 +01:00
Miklos Szeredi
8ff63b9e9b Highlevel lib: use dynamically resized hash table
Use dynamically resized hash table for looking up by name and node ID.

The chosen implementation is linear hashing, which features gradual
rehashing when while the size of the table increases.
2010-12-13 15:46:37 +01:00
Miklos Szeredi
ee7264ac00 Fix fuse_buf_copy_flags values
Reported-by: Goswin von Brederlow <goswin-v-b@web.de>
2010-11-12 16:18:17 +01:00
Miklos Szeredi
13a3d3636c update test/.gitignore 2010-11-12 15:50:22 +01:00
Miklos Szeredi
e099bda0d0 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.
2010-11-10 11:45:50 +01:00
Miklos Szeredi
6332203885 add read_buf method to high level API
Add a new read_buf() method to the highlevel API.  This allows
returning a generic buffer from the read method, which in turn allows
zero copy reads.
2010-11-10 11:41:21 +01:00
Miklos Szeredi
df31f2b11e add write_buf method to high level API
Add new write_buf() method to the highlevel API.  Similarly to the
lowlevel write_buf() method, this allows implementing zero copy
writes.
2010-11-10 11:41:21 +01:00
Miklos Szeredi
4367f2df50 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.
2010-11-10 11:41:21 +01:00
Miklos Szeredi
42bcaf301e 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.
2010-11-10 11:41:21 +01:00
Miklos Szeredi
1c5b7a8612 bump the API version as well to 2.9 2010-11-10 11:41:21 +01:00
Miklos Szeredi
3f41e8f2c3 libfuse: add retrieve request
Retrieve data stored in the kernel buffers for a given inode.
2010-11-08 21:13:32 +01:00
Miklos Szeredi
d04e0ea8ff fix changelog 2010-11-08 21:11:36 +01:00
Miklos Szeredi
f4d861ed02 fix pipe cleanup in do_write_buf() 2010-11-08 21:11:36 +01:00
Miklos Szeredi
86cbeb4203 Fix st_nlink for unlinked but still open files
Fix st_nlink value in high level lib if file is unlinked but still open
2010-11-08 19:43:41 +01:00
Miklos Szeredi
06f6f0b313 Add ctx->pid to debug output 2010-11-08 19:43:41 +01:00
Miklos Szeredi
0741f702a5 libfuse: add store request
Request data to be stored in the kernel buffers for a given inode.
2010-11-08 18:38:23 +01:00
Miklos Szeredi
2fcbc2a5a9 fusermount: don't save/restore cwd
Remove unnecessary restoring of current working directory in
"fusermount -u"
2010-11-08 17:53:47 +01:00
Miklos Szeredi
b8ce6e5026 bump version to 2.9.0-pre0 2010-11-08 17:13:22 +01:00
Miklos Szeredi
4e0aea6a96 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.
2010-11-08 17:11:46 +01:00
Miklos Szeredi
7d878eb13a Fix fuse_buf_copy() if already at the end of the buffers 2010-11-08 16:06:37 +01:00
Miklos Szeredi
eba226948b 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.
2010-11-08 16:00:16 +01:00
Miklos Szeredi
9b2ab7ebed Open /dev/null for write
Open /dev/null for write instead of read for redirecting stdout and
stderr
2010-11-08 15:47:36 +01:00
Miklos Szeredi
bd99f9cf24 Fix check for read-only fs in mtab update 2010-11-08 15:35:35 +01:00
Natanael Copa
41bc6c9372 Use LTLIBICONV when linking libfuse
This fixes building against uclibc + libiconv.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
2010-10-14 12:26:22 +02:00
mkmm@gmx-topmail.de
ec4a01f943 add missing argument check in ulockmgr.c
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.
2010-10-05 13:00:06 +02:00
Miklos Szeredi
824b4ce6ac Fix ambiguous symbol version for fuse_chan_new
fuse_versionscript included fuse_chan_new in both FUSE_2.4 and
FUSE_2.6.  Remove the FUSE_2.4, which is invalid.

Reported by Raymes Khoury, who discovered this with the gold linker
2010-09-28 20:04:02 +02:00
Miklos Szeredi
555d6b5043 Fix option escaping for fusermount.
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.

Reported by Jan Engelhardt
2010-09-28 19:22:24 +02:00
Miklos Szeredi
64222fbcbd 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

Patch from Emmanuel Dreyfus
2010-08-27 17:16:54 +02:00
Miklos Szeredi
7cc73a47dd cuse: fix minor typos in error messages
This basically was a
    %s/fuse:/cuse:/
to remove some apparent copy/paste errors.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
2010-08-27 13:29:54 +02:00
Miklos Szeredi
2709f9a53d libfuse: add buffer interface
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.
2010-07-12 17:17:25 +02:00
Miklos Szeredi
5454e4fa74 Add .gitignore files
Add .gitignore files and delete .cvsignore files.
2010-06-24 13:40:31 +02:00
Miklos Szeredi
ed5d070739 update fuse_kernel.h 2010-06-23 08:56:01 +00:00
Miklos Szeredi
8b2a7f59b3 * Make the number of max background requests and congestion
threshold tunable.
2010-06-23 08:33:32 +00:00
Miklos Szeredi
1091d73a28 Add fuse_reply_fd() reply function to the low level interface 2010-06-17 11:54:26 +00:00
Miklos Szeredi
ca14187b22 * 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.
2010-06-15 17:55:37 +00:00
Miklos Szeredi
aebdeefa64 * Fix out-of-source build. 2010-06-15 17:49:13 +00:00
Miklos Szeredi
6433d1b8cb * Remove "chmod root" from install of fusermount 2010-06-01 09:45:52 +00:00
Miklos Szeredi
754c488d98 * Fix checking for symlinks in umount from /tmp. Reported by Al
Viro

* Fix umounting if /tmp is a symlink.  Reported by Franco Broi
2010-04-26 15:29:08 +00:00