Age | Commit message (Collapse) | Author | Lines |
|
Add header guards, include system headers as needed, and declare
helper functions as inline.
This ensures that the helper header could be properly included.
Signed-off-by: CismonX <admin@cismon.net>
|
|
Move fallocate implementation to passthrough_helpers.h, so that
it could be reused by multiple passthrough examples.
Signed-off-by: CismonX <admin@cismon.net>
|
|
Signed-off-by: izxl007 <zeng.zheng@zte.com.cn>
|
|
Signed-off-by: Gleb Popov <6yearold@gmail.com>
|
|
Signed-off-by: Gleb Popov <6yearold@gmail.com>
|
|
Signed-off-by: Gleb Popov <6yearold@gmail.com>
|
|
Signed-off-by: Gleb Popov <6yearold@gmail.com>
|
|
Signed-off-by: Gleb Popov <6yearold@gmail.com>
|
|
Signed-off-by: Gleb Popov <6yearold@gmail.com>
|
|
Signed-off-by: Gleb Popov <6yearold@gmail.com>
|
|
Signed-off-by: izxl007 <zeng.zheng@zte.com.cn>
|
|
This patch modifies the notify_inval_entry.c example so that it includes
an extra option to use fuse_lowlevel_notify_increment_epoch(). The test
test_notify_inval_entry() was also modified to test this extra option.
Signed-off-by: Luis Henriques <luis@igalia.com>
|
|
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
|
|
Not ideal for git history, but the different
formatting within the project is really
disturbing.
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
|
|
This patch updates how to use the io_uring and io_uring_q_depth mount
options. There are two reasons for this:
1. It is recommended for end-users to use a format like “-o io_uring"
(with a space) in README.fuse-io-uring. This is because, in the
passthrough_hp example, cxxopts does not support the "-oio_uring"
format (without a space), and using it would result in a syntax error.
2. Remove redundant "--uring" and "--uring-q-depth=" from
passthrough_hp example.
Signed-off-by: izxl007 <zeng.zheng@zte.com.cn>
|
|
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
|
|
Signed-off-by: swj <1186093704@qq.com>
|
|
The high-level interface triggers flag conversion twice: once in the
high-level init and once in the low-level init. This caused false
"both 'want' and 'want_ext' are set" errors when using
fuse_set_feature_flag() or fuse_unset_feature_flag().
The existing check for duplicate conversion only worked when 32-bit
flags were set directly. When using the preferred flag manipulation
functions, conn->want and the lower 32 bits of conn->want_ext
would differ, triggering the error.
Fix this by synchronizing conn->want with the lower 32 bits of
conn->want_ext after conversion, ensuring consistent state for
subsequent calls.
Closes: https://github.com/libfuse/libfuse/issues/1171
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
|
|
These are several buf size fixes
1) Set bufsize when HAVE_SPLICE is not defined. Addresses
https://github.com/libfuse/libfuse/issues/1184
2) Check in the read retry condition for bufsize, i.e. the value
passed to read and not for the buf->mem_size. Using buf->mem_size
can be startup racy. Additionally we now also set bufsize on
allocation to avoid these races.
3) Allocation and value assigned needs to follow the pattern
bufsize = se->bufsize;
buf_alloc(bufsize, internal)
buf->mem_size = bufsize;
I.e. bufsize has to be retrieved first, as se->bufsize might
change at anytime - the value used for allocation and
must not differ from the value actually used.
This also tries to set large sizes in passthrough_hp, to catch
issues in xfstests - though requires to set
/proc/sys/fs/fuse/max_pages_limit
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
|
|
Add example bpftrace file for monitoring tracepoints.
Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
|
|
When building FUSE3 with Meson on CentOS 8, the fuse3.pc file gets
installed in /usr/local/lib64/pkgconfig. Since pkg-config doesn't search
this path by default, GCC compilation fails due to missing FUSE3 flags.
This patch adds an instruction for setting PKG_CONFIG_PATH variable in
README.compile to fix GCC compilation issues.
Signed-off-by: izxl007 <zeng.zheng@zte.com.cn>
|
|
When building and installing FUSE3 using Meson on CentOS8, the fuse3.pc
file is installed in the /usr/local/lib64/pkgconfig directory. However,
pkg-config does not search for fuse3.pc in this directory, leading to GCC
compilation failures.
This patch improves the compilation comments, helping users successfully
execute the GCC command.
Signed-off-by: izxl007 <zeng.zheng@zte.com.cn>
|
|
32-bit conn->want flags been left to be ABI compatible to 3.10,
even though the so version was changed.
The more recent way is to use fuse_set_feature_flag(),
which will use conn->want_ext.
Given that we now have two flags (want and want_ext), we need
to convert and that brought several issues
- If the application sets conn->want, that needs to be set into
the lower 32 bit of conn->want_ext. As the application might
actually unset values, it really has to be a copy and not
just 'or' - fixed now.
- convert_to_conn_want_ext() actually needs to check for
_modified_ conn->want and conn->want_ext
- convert_to_conn_want_ext() must consider being called from
high and lowlevel interfact, with different want_ext_default
and want_default values. It is only a failure, if the application
changed both, conn->want and conn->want_ext. This function
was failing in issue #1171, because high level fuse_fs_init()
was changing values and then lowlevel do_init() was incorrectly
failing on that.
This also adds a new test (test_want_conversion) and sets
values into example/{hello.c,hello_ll.c}
Also some more internal users of conn->want are converted to
fuse_{set,unset}_feature_flag().
Closes: https://github.com/libfuse/libfuse/issues/1171
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
|
|
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
|
|
The code uses std::min() which expects its arguments to be size_t. Two
times it uses an offset declared as off_t. While both size_t and off_t
are 32-bit integers, the latter is signed. On 64 bit architectures
the conversation of off_t -> size_t performed automatically. On 32 bit
architectures it needs a type cast.
Signed-off-by: Laszlo Boszormenyi (GCS) <gcs@debian.org>
|
|
This commit enables splice moves by default, unless the caller opts into
nosplice.
Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
|
|
Cleaning... 18 files.
[35/69] Compiling C object example/passthrough_ll.p/passthrough_ll.c.o
../example/passthrough_ll.c: In function ‘lo_opendir’:
../example/passthrough_ll.c:666:20: warning: ‘fd’ may be used uninitialized [-Wmaybe-uninitialized]
666 | if (fd != -1)
| ^
../example/passthrough_ll.c:637:13: note: ‘fd’ was declared here
637 | int fd;
| ^~
[38/69] Compiling C object test/test_syscalls.p/test_syscalls.c.o
../test/test_syscalls.c: In function ‘test_seekdir’:
../test/test_syscalls.c:804:16: warning: ‘de’ may be used uninitialized [-Wmaybe-uninitialized]
804 | while (de)
| ^~
../test/test_syscalls.c:776:24: note: ‘de’ was declared here
776 | struct dirent *de;
| ^~
These are actually valid.
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
|
|
passthrough example supports the --plus command line argument to reply
to readdirplus with fill_dir_plus and unspecified (0) fill offsets.
As explained in this comment:
https://github.com/libfuse/libfuse/pull/896#issuecomment-1978917041
passthrough example needs a few more changes to be able to test commit
dd95d13a ("fix readdirplus when filler is called with zero offset (#896))
With the changes in this commit, readdirplus without fill offsets
can be tested to verify the readdirplus fix above with command line:
passthrough --plus -o auto_cache,modules=subdir,subdir=/src /mnt
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
|
|
After pulling latest code, memfs_ll build would fail because it
builds with C++11.
Changing the default of cpp_std in meson.build is not enough to fix this
problem even if user runs 'meson setup --reconfigure'.
I had to run 'meson setup -Dcpp_std= --reconfigure' to fix the build
as mentioned in this meson issue:
https://github.com/mesonbuild/meson/issues/8062#issuecomment-1568249672
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
|
|
In cache=always mode, set keep_cache flag in opendir(), same as done
in open() and same as passthrough_hp does in opendir().
In the default cache=auto mode, use readdir cache, but do not set
keep_cache, same as regular files use page cache for an open file,
but do not keep_cache for a new open.
Note that passthrough_hp by default behaves the same as passthrough_ll
cache=always mode and supports the cache=never mode with --nocache, but
it does not support the equivalent of cache=auto mode.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
|
|
The previous fields are left for ABI compatibility, although
it is not beautiful to add that complexity when we have to increase
the so-version as we had ABI breakage anyway.
example/printcap is simplified to use an array, as every line would
have needed to be modified anyway. Missing 'FUSE_CAP_PASSTHROUGH'
was added.
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
|
|
This is an initial implementation and quickly hacked together
within a few hours - issues expected.
This also increase to C++17 as memfs_ll makes use of more
recent features.
Background to create this was actually to be able to test large
file names (3 * 1024B), which couldn't be achieved with passthrough
file system as non of the underlying file systems seems to support
that.
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
|
|
Note that name hashes and using paths as parameters
makes it very hard to support
anonymous files in the high level API.
Known Issues:
- tests have to bail out when O_TMPFILE is not supported.
This will always be the case with high level passthrough implementations.
- test_create_and_link_tmpfile has to be skipped
due to unidentified problems with github runner
|
|
This should stop some more xfstest test failures.
|
|
Simplify setting feature flags a bit by adding a helper
function.
Also move the check for valid flags into a funtion we can re-use
in a later patch.
|
|
fuse_loop_cfg_set_idle_threads() was by accident and
setting it might cause a performance issue.
|
|
These flags should be also set for O_CREAT
|
|
sfs_open and sfs_create set fi->direct_io (FOPEN_DIRECT_IO) when
O_DIRECT is given, in order to benefit from a shared inode lock
in kernel, i.e. to get parallel DIO writes. However, kernel side
disabled passthrough when FOPEN_DIRECT_IO is set. Reads/writes
had been totally failing in this case for O_DIRECT as
sfs_write_buf() and sfs_read() have a sanity check. That sanity
check could be modified, but for performance passthrough is
better than parallel DIO, hence, we only want automatic
FOPEN_DIRECT_IO for O_DIRECT when passthrough is not enabled.
Fixes: https://github.com/libfuse/libfuse/issues/1027
This also fixes automatically switching to FOPEN_DIRECT_IO
for O_DIRECT in sfs_create().
|
|
High level examples were already using it, but not
lowlevel. Also update the documentation.
|
|
fuse_config.h is used in libfuse internally. This may confuse developers
that fuse_config.h is used in the examples.
|
|
This is an addition to commit e75d2c54a347. This example sets
FUSE_USE_VERSION = 34 but uses fuse_loop_cfg_* APIs, which is
not allowed since these APIs are not introduced in version 34.
|
|
Fix some clang-tidy warnings.
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
|
|
This is an addition to commit a8f1ae35af66, which
introduced the 312 API, but didn't set the right
API version in all examples.
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
|
|
Commit 170edc6a8ef0 added dot and dotdot (. and ..) to readdir
results, but introduced an issue when max number of entries
was reached - lookup count must not be decreased without
doing the lookup.
With ext4 as underlying file system readir seems to return . and ..
at random offsets and randomly failed xfstests for me.
This also fixes indentation, as passthrough_hp.cc does not follow
the linux indentation style (if we decide to fix this, it needs
to be done for the entire file).
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
|
|
I see random ENOTCONN failures in xfstest generic/013 and generic/014
in my branch, but earliest on the 2nd run - takes ~12hours to get
the issue, but then there are no further information logged.
ENOTCONN points to a daemon crash - I need backtraces and a core dump.
This adds optional handling of fatal signals to print a core dump
and optional syslog logging with these new public functions:
fuse_set_fail_signal_handlers()
In addition to the existing fuse_set_signal_handlers(). This is not
enabled together with fuse_set_signal_handlers(), as it is change
in behavior and file systems might already have their own fatal
handlers.
fuse_log_enable_syslog
Print logs to syslog instead of stderr
fuse_log_close_syslog
Close syslog (for now just does closelog())
Code in fuse_signals.c is also updated, to be an array of signals,
and setting signal handlers is now down with a for-loop instead
of one hand coded set_one_signal_handler() per signal.
|
|
generic/401 fails currently because it checks that "." and ".." are
listed as directory entries.
Include "." and ".." as listed directory entries in passthrough_hp's
readdir implementation.
Signed-off by: Joanne Koong <joannelkoong@gmail.com>
|
|
Follow the same format as other arguments passed to example commands.
|
|
Notifications should be enabled here, but present command example would disable them.
|
|
should use EBADF instead
|
|
since there's no splice(2) support
|