Age | Commit message (Collapse) | Author | Lines |
|
This patch adds support for the FUSE INC_EPOCH notify. This new operation
simply increments the FUSE connection epoch value, allowing to invalidate
all the dentries next time they are revalidated.
Signed-off-by: Luis Henriques <luis@igalia.com>
|
|
fuse_apply_conn_info_opts() was applying to 'want_ext',
which would cause conflicts with 'want' if the application
applied its own flags to 'conn->want'.
Solution is:
- to move fuse_{set,unset,get}_feature_flag and
convert_to_conn_want_ext() to fuse_lowlevel.c and
to define them as part of the public API, although
convert_to_conn_want_ext() should not be used - it is
currently needed to be a public function due as it needs
to be defined for the tests.
Related to https://github.com/libfuse/libfuse/issues/1171 and
https://github.com/libfuse/libfuse/pull/1172.
Closes: https://github.com/libfuse/libfuse/issues/1171
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
|
|
This adds the libfuse changes needed to support request timeouts.
A timeout may be set by the server in its init call. If a request is not
completed by the timeout, the connection will be aborted by the kernel.
Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
|
|
Sync include/fuse_kernel.h with the most up to date fuse
uapi headers in the kernel.
Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
|
|
This might be useful to optimize code paths. For example, with
io-uring the request buffer is valid until the request is replied
to, while without io-uring the request buffer is only valid
in current thread context.
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
|
|
Ensure it is correctly stored in an unsigned 32 bit int.
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
|
|
Also add FUSE_CAP_OVER_IO_URING
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
|
|
Newer gccs now use -Werror=redundant-decls which means that anyone
including fuse.h is getting an error of:
/usr/include/fuse3/fuse.h:959:5: error: redundant redeclaration of ‘fuse_main_real_versioned’ [-Werror=redundant-decls]
959 | int fuse_main_real_versioned(int argc, char *argv[],
| ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/fuse3/fuse.h:885:5: note: previous declaration of ‘fuse_main_real_versioned’ with type ‘int(int, char **, const struct fuse_operations *, size_t, struct libfuse_version *, void *)’ {aka ‘int(int, char **, const struct fuse_operations *, long unsigned int, struct libfuse_version *, void *)’}
885 | int fuse_main_real_versioned(int argc, char *argv[],
| ^~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
|
|
At the moment build fails due to lack of static_assert:
https://gitlab.com/jolivain/buildroot/-/jobs/9606292537
this means that the check per date is not enough, so let's use meson to
check if static_assert() is present or not and simplify
fuse_static_assert() definition by only checking HAVE_STATIC_ASSERT.
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
|
|
Closes: https://github.com/libfuse/libfuse/issues/1168
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
|
|
Some applications use that for detection of features between
distributions/libfuse version.
Closes: https://github.com/libfuse/libfuse/issues/1163
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
|
|
libfuse-3.17 introduced several functions that should only be called via
inlined helper functions, never directly. To enforce this, these functions
were declared within the inlined functions. However, this triggers the
compiler warning "-Werror=nested-externs".
While this warning is valid, the nested declarations were intentional to
prevent direct usage of these functions. Rather than suppressing the
warning with pragmas, move these function declarations outside the helper
functions while maintaining the intended access restrictions through other
means.
Closes: https://github.com/libfuse/libfuse/issues/1134
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
|
|
See https://github.com/libfuse/libfuse/issues/1125
Signed-off-by: Maksim Harbachou <maksim.harbachou@resilio.com>
|
|
Another additon for https://github.com/libfuse/libfuse/issues/1092
Use _fuse_new_versioned() instead of _fuse_new_317 and actually
also remove symbol versioning for it - we don't need it.
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
|
|
Acidentally the wrong non-existing function was ccalled.
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
|
|
Similar previous renames to fuse_main_real_versioned,
but here for the low level fuse_session_new.
Also remove symbol versioned as part of "fuse_session_new"
as that function is not part of the official API/ABI
and to allow easier access with dlopen/dlsym.
Also switch back to a macro fuse_session_new, just in
case some code has some expectations on that.
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
|
|
As suggested by Bill in Issue #1092 make fuse_main a macro again,
just in case some applications expect it to be a macro.
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
|
|
As suggested by Bill in Issue #1092, rename to _versioned
so that applications using dlopen/dlvsym better understand
the meaning of this function.
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
|
|
Comments for fuse_reply_open and fuse_reply_create and with that
doxygen had not been updated for parallel_direct_writes and others.
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
|
|
Addresses https://github.com/libfuse/libfuse/issues/1092
We actually don't need to make fuse_main_real() symboled, as it
is not part of the official API.
The inlined function now always calls into fuse_main_real_317
and the compat ABI function (which should also be available
for dlopen/dlsym) is now always compiled, independent if the
compiler/linker support versioned symbols.
Additionally, fuse_main_real() is also declared as inlined
function and a warning message is created when that function
is called.
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
|
|
_fuse_new() is not supposed to be called by external users
outside of internal functions or static inlined functions.
This also removes several functions from lib/fuse_versionscript
which where added and exported by
commit 58f85bfa9b7d ("Add in the libfuse version a program...)
as these are libfuse internal only.
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
|
|
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
|
|
Signed-off-by: Bernd Schubert <bernd@bsbernd.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>
|
|
Should be used internally only, but is still in a common file -
we better use arch independent values.
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
|
|
Add a flags and reserved fields to struct fuse_file_info
and add a static assert on the size.
Also add another static assert for 'struct fuse_conn_info'
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
|
|
Now that we know the exact size of the integer we can
use a single bit and reserve the other bits.
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
|
|
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
|
|
pahole was showing a 4 byte hole - add another padding to
fill that hole.
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
|
|
Enforce 32 bit integers for #struct fuse_file_info'.
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
|
|
Enforce 32-bit integers for struct fuse_config and
add future ABI fields to that struct.
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
|
|
This fixes commit
dad15aee26835 "Add no_rofd_flush mount option"
and restores the ABI by moving the no_rofd_flush field.
Given that there were already several releases with this commit
we will still need an so version bump.
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
|
|
This fixes commit
a5eb7f2 "Enable parallel direct writes on the same file"
and restores the ABI by moving the parallel_direct_writes
bit.
Given that there were already several releases with this commit
we will still need an so version bump.
Signed-off-by: Bernd Schubert <bernd@bsbernd.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
|
|
A previous PR supported extended max writes (eg write requests larger than 1 MB)
by initializing the fuse session buffer size to use the max_pages_limit set in
/proc/sys/fs/fuse. However, this is a huge problem for machines where multiple
fuse servers may be running but only one server needs large writes. In this case,
a lot of memory will be wasted and will lead to OOM issues.
This PR does a reallocation of the session buffer transparently if the server set
"se->conn.max_write" to a value larger than 1 MiB. This is only for buffers that
are "owned" by libfuse - if the server wishes to provide its own allocated buffer
for receiving/processing requests, then it should ensure that buffer is allocated
to the proper size from the start.
Local testing showed:
echo 65535 | sudo tee /proc/sys/fs/fuse/max_pages_limit
dd if=/dev/urandom of=hello_file bs=6M count=2
write requests:
write request size is 5242880
write request size is 1048576
write request size is 5242880
write request size is 1048576
|
|
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* operations are introduced in fuse version 312 and
can not be used in an early version.
Also fix some typo.
|
|
High level examples were already using it, but not
lowlevel. Also update the documentation.
|
|
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
|
|
After commit 54466d2c426b compilation was failing on my debian VM.
|
|
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.
|
|
These are not all ABI sensitive data structures yet.
Also some space vs tab indentation issues are corrected.
|
|
dmask: umask applied to directories
fmask: umask applied to non-directories
to get "typical" permission bits for regular files (0644) and directories (0755), a single
umask option is not sufficient (or well, it isn't the way fuse implements it)
there is precident for separate umask and dmask options in other
filesystems (see for example fat: https://github.com/torvalds/linux/tree/master/fs/fat)
this addition should not affect backward-compatibility; the original
umask option retains the same meaning, but non-zero fmask or
dmask will override it.
|
|
The function fuse_session_process_buf_int() would do much things
for FUSE_INTERRUPT requests, even there are no FUSE_INTERRUPT requests:
1. check every non-FUSE_INTERRUPT request and add these requests to the
linked list(se->list) under a big lock(se->lock).
2. the function fuse_free_req() frees every request and remove them from
the linked list(se->list) under a bing lock(se->lock).
These operations are not meaningful when there are no FUSE_INTERRUPT requests,
and have a great impact on the performance of fuse filesystem because the big
lock for each request.
In some cases, FUSE_INTERRUPT requests are infrequent, even none at all.
Besides, the user-defined filesystem may do nothing for FUSE_INTERRUPT requests.
And the kernel side has the option "no_interrupt" in struct fuse_conn. This kernel option
can be enabled by return ENOSYS in libfuse for the reply of FUSE_INTERRUPT request.
But I don't find the code to enable the "no_interrupt" kernel option in libfuse.
So add the no_interrupt support, and when this operaion is enabled:
1. remove the useless locking operaions and list operations.
2. return ENOSYS for the reply of FUSE_INTERRUPT request to inform the kernel to disable
FUSE_INTERRUPT request.
|
|
Fixes: 73cd124d0408 ("Add clone_fd to custom IO (#927)")
Signed-off-by: Xiaoguang Wang <lege.wang@jaguarmicro.com>
|
|
Add support for filesystem passthrough read/write of files.
When the FUSE_PASSTHROUGH capability is enabled, the FUSE server may
decide, while handling the "open" or "create" requests, if the given
file can be accessed by that process in "passthrough" mode, meaning that
all the further read and write operations would be forwarded by the
kernel directly to the backing file rather than to the FUSE server.
All requests other than read or write are still handled by the server.
This allows for an improved performance on reads and writes, especially
in the case of reads at random offsets, for which no (readahead)
caching mechanism would help, reducing the performance gap between FUSE
and native filesystem access.
Extend also the passthrough_hp example with the new passthrough feature.
This example opens a kernel backing file per FUSE inode on the first
FUSE file open of that inode and closes the backing file on the release
of the last FUSE file on that inode.
All opens of the same inode passthrough to the same backing file.
A combination of fi->direct_io and fi->passthrough is allowed.
It means that read/write operations go directly to the server, but mmap
is done on the backing file.
This allows to open some fds of the inode in passthrough mode and some
fd of the same inode in direct_io/passthrough_mmap mode.
Signed-off-by: Alessio Balsini <balsini@android.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
|
|
The API stays the same, the libfuse version comes from
inlined functions, which are defined fuse_lowlevel.h
and fuse.h. As these inlined functions are defined in the header
files they get added into the application, similar as if these
were preprocessor macros.
Macro vs inlined function is then just a style issue - I personally
prefer the latter.
fuse_session_new() -> static inlinei, in the application
_fuse_session_new -> inside of libfuse
fuse_new() -> static inline, in the application
_fuse_new() -> inside of libfuse
Note: Entirely untested is the fuse 30 api - we need a test
for it. And we do not have any ABI tests at all.
Signed-off-by: Bernd Schubert <bernd.schubert@fastmail.fm>
|
|
If the file system doesn't provide a ->open or an ->opendir, and the
kernel supports FUSE_CAP_NO_OPEN_SUPPORT or FUSE_CAP_NO_OPENDIR_SUPPORT,
allow the implementation to set FUSE_CAP_NO_OPEN*_SUPPORT on conn->want
in order to automatically get this behavior. Expand the documentation
to be more explicit about the behavior of libfuse in the different cases
WRT this capability.
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
|
|
_Static_assert() is an ISO C11 feature. Make the check more
standard-conformant so that the compiler won't give pedantic warnings.
|