Age | Commit message (Collapse) | Author | Lines |
|
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.
|
|
* Use single place to define the version
Defining the version in fuse_common.h, is removed, it is defined
through meson and provided by "libfuse_config.h". I.e. it avoids
to define the version twice - once in meson and once in
fuse_common.h.
Ideal would be to set integers in the meson file and create the version
string from these integers. However, meson requires that "project"
is the first meson.build keyword - with that it requires to
set the version from a string and then major/minor/hotfix integers
are created from string split.
Signed-off-by: Bernd Schubert <bernd.schubert@fastmail.fm>
* Increase the version to 3.17.0
This is to prepare the branch for the next release.
Signed-off-by: Bernd Schubert <bernd.schubert@fastmail.fm>
---------
Signed-off-by: Bernd Schubert <bernd.schubert@fastmail.fm>
|
|
Define a new clone_fd() helper for fuse_custom_io, users
can implement their own clone fd logic.
Signed-off-by: Xiaoguang Wang <lege.wang@jaguarmicro.com>
|
|
Add more documentation for FUSE_CAP_EXPORT_SUPPORT
Also remove the flag from passthrough_ll.c and passthrough_hp.cc
as these implementations do _not_ handle that flag. They just
cast fuse_ino_t to an inode and cause a heap buffer overflow
for unknown objects (simplest reproducer are the examples
in "man 2 open_by_handle_at", but to unmount/mount the file
system after name_to_handle_at and before open_by_handle_at).
Fixes https://github.com/libfuse/libfuse/issues/838
---------
Co-authored-by: Nikolaus Rath <Nikolaus@rath.org>
|
|
This just adds in the basic handler, but does not
use it yet in examples.
|
|
Commit 22741f5 accidentally re-used (1 << 27), which is
already taken for FUSE_CAP_SETXATTR_EXT.
Fortunately not part of any release yet.
|
|
In order to use the fuse_fill_dir_t function in a C++ program, add the enum item:
FUSE_FILL_DIR_DEFAULTS
Without this change g++ compilation failed with
example/hello.c:94:35: error: invalid conversion from ‘int’ to ‘fuse_fill_dir_flags’ [-fpermissive]
94 | filler(buf, ".", NULL, 0, 0);
| ^
| |
| int
|
|
'FUSE_CAP_HANDLE_KILLPRIV' is not enabled by default anymore, as that
would be a sudden security issue introduced by a new ABI and API
compatible libfuse version.
|
|
Allowing parallel dir operations could result in a crash in a filesystem
implementation that is not prepared for this.
To be safe keep this flag off by default (this is not a regression, since
there was no public release where this flag wasn't ignored).
If the filesystem wants better performance, then it should set this flag
explicitly.
Fixes: c9905341ea34 ("Pass FUSE_PARALLEL_DIROPS to kernel (#861)")
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
|
|
This is not called FUSE_CAP_DIRECT_IO_RELAX, as the kernel flag
FUSE_DIRECT_IO_RELAX is supposed to be renamed to
FUSE_DIRECT_IO_ALLOW_MMAP. The corresponding kernel patches just
did not land yet.
|
|
Add in the rename of FUSE_DIRECT_IO_RELAX to
FUSE_DIRECT_IO_ALLOW_MMAP.
|
|
|