| Commit message (Collapse) | Author | Age |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The bug occurs when a filesystem client reads a directory until the end,
seeks using seekdir() to some valid non-zero position and calls
readdir(). A valid 'struct dirent *' is expected, but NULL is returned
instead. Pseudocode demonstrating the bug:
DIR *dp = opendir("some_dir");
struct dirent *de = readdir(dp);
/* Get offset of the second entry */
long offset = telldir(dp);
/* Read directory until the end */
while (de)
de = readdir(de);
seekdir(dp, offset);
de = readdir(dp);
/* de must contain the second entry, but NULL is returned instead */
The reason of the bug is that when the end of directory is reached, the
kernel calls FUSE_READDIR op with an offset at the end of directory, so
the filesystem's .readdir callback never calls the filler function, and
we end up with dh->filled set to 1. After seekdir(), FUSE_READDIR is
called again with a new offset, but this time the filesystem's .readdir
callback is never called, and an empty reply is returned.
Fix by setting dh->filled to 1 only when zero offsets are given to
filler function.
|
|
|
|
| |
Fix conditionals as per maintainer's request.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Linux performs the dir loop check (rename(a, a/b/c)
or rename(a/b/c, a), etc.) in kernel. Unfortunately
other systems do not perform this check (e.g. FreeBSD).
This results in a deadlock in get_path2, because libfuse
did not expect to handle such cases.
We add a check_dir_loop function that performs the dir
loop check in user mode and enable it on systems that
need it.
|
|
|
|
|
|
|
| |
Ensure that conf is always zero before it's read from to prevent
sporadic failure at startup if higher layers were build against
version 3.0
Signed-off-by: Ashley Pittman <ashley.m.pittman@intel.com>
|
|
|
|
|
|
|
|
|
| |
This change is bogus. fuse_module_factory_t is already a pointer
type. Additionally, if dlsym returns NULL, then you will be
dereferencing it causing a segfault. In my testing, a segfault will
happen even if dlsym returns successfully.
Thanks to Michael Theall for spotting!
|
|
|
|
|
|
| |
dlsym() resolves the location of the loaded symbol,
therefore dlsym() returns the type (fuse_module_factory_t *), not (fuse_module_factory_t).
Added pinter dereferencing to correctly refer the factory function.
|
|
|
|
|
| |
This was detected by using clang's undefined behavior sanitizer, but
didn't seem to cause problems in practice.
|
|
|
|
|
|
| |
The old versions of these symbols were defined with version
tag FUSE_3.0, so this is what we have to use in the .symver
directive.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The fuse_session_loop_mt() and fuse_loop_mt() symbols are only visible
when linking against the shared object. The code in lib/, however, is
compiled *into* the shared object and should thus use the internal
names of these functions.
Surprisingly enough, the code still worked before - but only when link
time optimization was disabled.
Unfortunately, we still can't compile with LTO because it seems that
enabling LTO somehow makes the tagged symbols vanish.
Without lto, we have:
$ nm lib/libfuse3.so | grep fuse_new
0000000000011070 T fuse_new_30
0000000000010a00 t fuse_new_31
0000000000011070 T fuse_new@FUSE_3.0
0000000000010a00 T fuse_new@@FUSE_3.1
and with LTO:
$ nm lib/libfuse3.so | grep fuse_new
0000000000019a70 T fuse_new_30
0000000000019270 t fuse_new_31
See also issue #198.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
We re-introduce the functionality of invalidating the caches for an
inode specified by path by adding a new routine
fuse_invalidate_path. This is useful for network-based file systems
which use the high-level API, enabling them to notify the kernel about
external changes.
This is a revival of Miklos Szeredi's original code for the
fuse_invalidate routine.
|
|
|
|
| |
cfg.has('HAVE_ICONV') was always true.
|
|
|
|
| |
this fixes building with lto, which failed since commit 503e32d01e4db00e90d7acfd81ab05386559069f
|
|
|
|
| |
FreeBSD kernel does not support this.
|
|
|
|
|
| |
This function shouldn't be called when using a newer fuse
version, so we should not define it in that case.
|
|
|
|
|
|
|
| |
I believe this function call is resolved by the compiler, not
the linker, so this seems safer.
Thanks to Chris Clayton for spotting this.
|
|
|
|
|
| |
GCC 4.8 doesn't like to rename fuse_new_30 to fuse_new, if we
also define an implementation for fuse_new.
|
| |
|
|
|
|
|
|
|
|
| |
Some variables of different size and sign were getting compared
without any safe casting.
The build system also throws warnings at this and, being this
library used for filesystems, it's really important to ensure
stability.
|
| |
|
|
|
| |
Redundant copy when only op.read is available removed.
|
| |
|
|
|
|
| |
fi may be NULL, so we need to protect against this.
|
|
|
|
|
|
| |
Modifying struct fuse_config in the init() handler is the canonical way
to adjust file-system implementation specific settings. There is no need
to have flags in struct fuse_operations.
|
|
|
|
|
|
| |
Several options (use_ino, etc) depend on the file system
implementation. Allowing them to be set from the command line makes no
sense.
|
| |
|
|
|
|
|
|
|
| |
We now only list options that are potentially useful for an
end-user (and unlikely to accidentally break a file system). The full
list of FUSE options has been moved to the documentation of the
fuse_new() and fuse_session_new() functions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We are overriding this setting with the flag in struct fuse_operations:
$ example/hello -f -d ~/tmp/mnt
FUSE library version: 3.0.0pre0
nopath: 0
unique: 1, opcode: INIT (26), nodeid: 0, insize: 56, pid: 0
INIT: 7.25
flags=0x0007fffb
max_readahead=0x00020000
INIT: 7.23
flags=0x00006031
max_readahead=0x00020000
max_write=0x00020000
max_background=0
congestion_threshold=0
time_gran=0
unique: 1, success, outsize: 80
$ example/hello -f -d ~/tmp/mnt -o nopath
FUSE library version: 3.0.0pre0
nopath: 0
unique: 1, opcode: INIT (26), nodeid: 0, insize: 56, pid: 0
INIT: 7.25
flags=0x0007fffb
max_readahead=0x00020000
INIT: 7.23
flags=0x00006031
max_readahead=0x00020000
max_write=0x00020000
max_background=0
congestion_threshold=0
time_gran=0
unique: 1, success, outsize: 80
|
|
|
|
|
|
| |
This obsoletes the ftruncate & fgetattr handlers.
Fixes #58.
|
|
|
|
|
|
| |
Instead of using command line options to modify struct fuse_conn_info
before and after calling the init() handler, we now give the file system
explicit control over this.
|
|
|
|
|
|
| |
This option really affects the behavior of the session loop, not the
low-level interface. Therefore, it does not belong in the fuse_session
object.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a code simplification patch.
- It confines most of the implementation channel implementation into
fuse_loop_mt (which is its only user).
- It makes it more obvious in the code that channels are only ever used
when using -o clone_fd and multi-threaded main loop.
- It simplies the definition of both struct fuse_session and struct
fuse_chan.
- Theoretically it should result in (minuscule) performance
improvements when not using -o clone_fd.
- Overall, it removes a lot more lines of source code than it adds :-).
|
|
|
|
| |
There is no point in having a separate file for a 10 line function.
|
|
|
|
|
| |
This should make more clear what file contains code for what
purpose.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Help and version messages can be generated using the new
fuse_lowlevel_help(), fuse_lowlevel_version(), fuse_mount_help(), and
fuse_mount_version() functions.
The fuse_parse_cmdline() function has been made more powerful
to do this automatically, and is now explicitly intended only
for low-level API users.
This is a code simplication patch. We don't have to parse for --help and
--version in quite as many places, and we no longer have a low-level
initialization function be responsible for the (super-high level) task
of printing a program usage message.
In the high-level API, we can now handle the command line parsing
earlier and avoid running other initialization code if we're just going
to abort later on.
|
|
|
|
| |
Also, do not include "General options" in usage message.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The only struct fuse_chan that's accessible to the user application is
the "master" channel that is returned by fuse_mount and stored in struct
fuse_session.
When using the multi-threaded main loop with the "clone_fd" option, each
worker thread gets its own struct fuse_chan. However, none of these are
available to the user application, nor do they hold references to struct
fuse_session (the pointer is always null).
Therefore, any presence of struct fuse_chan can be removed
without loss of functionality by relying on struct fuse_session instead.
This reduces the number of API functions and removes a potential source
of confusion (since the new API no longer looks as if it might be
possible to add multiple channels to one session, or to share one
channel between multiple sessions).
Fixes issue #17.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Applied (whitespace-cleanup) to each file. Having whitespace changes
in the VCS is ugly, but it ensures that in the future committers
can run this function to *avoid* commiting any whitespace.
|
| |
|
| |
|
|
|
|
| |
Reported by Eric Biggers
|
|
|
|
| |
See renameat2() system call in linux-3.15 and later kernels.
|
|
|
|
|
|
| |
to zero in all cases.
Reported by Daniel Iwan.
|
|
|
|
|
|
|
|
|
|
| |
Reuse the old "readdir" callback, but add a flags argument, that has
FUSE_READDIR_PLUS in case this is a "plus" version. Filesystems can safely
ignore this flag, but if they want they can add optimizations based on it:
i.e. only retrieve the full attributes in PLUS mode.
The filler function is also given a flags argument and the filesystem can
set FUSE_FILL_DIR_PLUS if all the attributes in "stat" are valid.
|