Age | Commit message (Collapse) | Author | Lines |
|
Signed-off-by: izxl007 <zeng.zheng@zte.com.cn>
|
|
Function fuse_set_thread_name() assumes that pthread_t is an unsigned long
and fails to compile in musl libc with the following:
../lib/util.c: In function 'fuse_set_thread_name':
../lib/util.c:48:28: error: passing argument 1 of 'pthread_setname_np' makes \
pointer from integer without a cast [-Wint-conversion]
Fix fuse_set_thread_name() by dropping the 'tid' parameter, as it is always
set to pthread_self().
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>
|
|
there are too many issues with conn->want and conn->want_ext
conversion, for now just log a warning, but setting both
flags is now not fatal anymore.
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>
|
|
Signed-off-by: izxl007 <zeng.zheng@zte.com.cn>
|
|
Refactor handler logic to make it more readable.
No functional changes.
Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
|
|
Also update the comment description of fuse_uring.c
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
|
|
So far it was disabled as the series was not complete
yet.
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
|
|
We want to especially test with and without io-uring being
enabled. Ideally without modifying all tests - that is
what the env variable can be used for.
Signed-off-by: Bernd Schubert <bschubert@ddn.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>
|
|
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
|
|
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
|
|
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
|
|
Not function yet, just preparation.
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
|
|
It will never be modified, should be const.
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
|
|
The actual function to write to /dev/fuse is offloaded
into _fuse_send_msg()
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
|
|
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
|
|
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
|
|
Avoid splattering the code with ifdef
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
|
|
Needed by follow up commits. container_of is actually
just moved/consolidated to util.h.
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
|
|
Header/payload separation is part of the fuse-io-uring protocol
and might be later on for /dev/fuse legacy communication as well.
This is a preparation commit, for now fuse_ll_ops2 is unused.
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
|
|
Issue with previous code was that fuse_session_exit()
didn't wake up the semaphore in fuse_loop_mt.c.
Lock, semaphore and all uses of checking for "exited"
are now moved to struct fuse_session to have it
available for the signal handler.
This also removes internal fuse_session_reset() calls,
as that makes testing hard. From git history I also
don't see why it was added.
Closes: https://github.com/libfuse/libfuse/issues/997
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
|
|
Commit dae1184 ("Add syslog and fatal signal handler feature")
added fuse_set_fail_signal_handlers() which can store
"se". But as fuse_set_signal_handlers() also stores the object
storing it was made conditionally if not set already.
As per https://github.com/libfuse/libfuse/issues/1182 this
breaks some applications like osspd, that have multiple
sessions and rely on the right order and that the last
call of fuse_set_signal_handlers() wins.
Special thanks to Sébastien Noel to debug this issue.
Closes: https://github.com/libfuse/libfuse/issues/1182
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
|
|
Since pthread_setname_np() is the only pthread function that requires NPTL
and it basically only set thread name, let's check if pthread_setname_np()
does exist, otherwise let's not call pthread_setname_np() to shrink
dependencies.
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.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>
|
|
For kernel development it might be necessary to load a module with
renamed symbols and renamed /dev/<devicenode>. Reason is that for
example ubuntu kernels have fuse compiled in and it is not possible
to replace it at run time. And fuse might also be used for other file
systems - a different device node is then needed. Also consolidate
device path handling and remove unnecessary string duplication in
mount_fuse() in fusermount.c.
Signed-off-by: Meng Lu Wang <mwang@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>
|
|
Default is having usdt disabled.
Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
|
|
Add user statically-defined tracepoints for request lifecycle.
Verified by:
[machine]$ readelf -n /home/libfuse/build/lib/libfuse3.so | grep -A 1000 '.note.stapsdt'
Displaying notes found in: .note.stapsdt
Owner Data size Description
stapsdt 0x00000035 NT_STAPSDT (SystemTap probe descriptors)
Provider: libfuse
Name: request_receive
Location: 0x0000000000016360, Base: 0x00000000000002fc, Semaphore: 0x0000000000000000
Arguments: -4@%edi
stapsdt 0x00000055 NT_STAPSDT (SystemTap probe descriptors)
Provider: libfuse
Name: request_reply
Location: 0x0000000000017c0f, Base: 0x00000000000002fc, Semaphore: 0x0000000000000000
Arguments: 8@8(%r12) 4@(%r12) -4@4(%r12) -4@%r13d
stapsdt 0x0000003e NT_STAPSDT (SystemTap probe descriptors)
Provider: libfuse
Name: request_process
Location: 0x000000000001acf7, Base: 0x00000000000002fc, Semaphore: 0x0000000000000000
Arguments: 4@%r8d 4@%edx
Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
|
|
Copy over usdt.h from [1] as part of the prepatory work for adding
tracepoints for requests.
[1] https://github.com/libbpf/usdt
Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
|
|
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>
|
|
This is to avoid checkpatch reports and might potentially
avoid future issues if these macros would be part of
conditions.
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
|
|
se->buf_reallocable is true when reading /dev/fuse is handled
from internal functions - we can set the variable in
fuse_session_receive_buf_internal(). With that we also
don't need to have it an _Atomic variable anymore.
In _fuse_session_receive_buf() we can use "bool internal"
to check if the buffer can be re-allocated.
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
|
|
This fixes dynamic buffer allocation in commit
0e0f43b79b9b ("Reallocate fuse_session buffer...")
I noticed that when I increased the default fuse buf size as
possible in recent kernels.
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
|
|
fuse_log_level is guaranteed to be the same as libc as syslog is
a network protocol and levels are numerical constants enforced in
RFCs. Syslog is originally BSD-only and was imported by glibc and
standardised in SUS and POSIX.
Use vsyslog rather than formatting a new intermediate string.
Signed-off-by: Vassili Tchersky <vt+git@vbc.su>
|
|
Don't spawn a setuid children with FD 1&2 closed.
Check status and not errno after posix_spawn(p).
Add comments to fix later error checking, as
posix_spawn(p) returns non-zero status only if
clone/vfork/rfork fails. If only setup (open, dup2)
or execve fails, the forked process exit with 127
but posix_spawn returns zero.
Signed-off-by: Vassili Tchersky <vt+git@vbc.su>
|
|
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>
|
|
Removed:
- <sys/user.h>: used to be for kinfo_proc, long gone from the code
- <paths.h>: used to be for _PATH_DEV and _PATH_DEVNULL, long gone
- <limits.h>: used to be for _POSIX2_LINE_MAX, long gone
- <sys/stat.h>: used to be for fstat/stat, long gone
Signed-off-by: Vassili Tchersky <vt+git@vbcy.org>
|
|
Log on unmount() and close() failure
Signed-off-by: Vassili Tchersky <vt+git@vbcy.org>
|
|
Use _exit() instead of exit() inside children
Signed-off-by: Vassili Tchersky <vt+git@vbcy.org>
|
|
These options never had any effect.
See https://svnweb.freebsd.org/base?view=revision&revision=347544
Signed-off-by: Vassili Tchersky <vt+git@vbcy.org>
|
|
The check on fd < 0 was recently removed. However, this check is important
as the content of FUSE_DEV_FD is passed as-is to mount_fusefs, and a string
beginning by '-' is treated as an option.
Additionally, add a proper include and type.
Signed-off-by: Vassili Tchersky <vt+git@vbcy.org>
|
|
Somehow really hard to set -rcX with meson.
Signed-off-by: Bernd Schubert <bernd@bsbernd.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>
|
|
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>
|
|
The comment is probably a leftover from older versions, as the application
of the 32 bits of conn.capable_ext to conn.capable is done before function
convert_to_conn_want_ext() is invoked.
Signed-off-by: Luis Henriques <luis@igalia.com>
|
|
Because conn.want_ext is a uint64_t, copying it into a uint32_t may result
in truncating it's value. This patch fixes a bug in do_init() where the
32 bits copy is again converted into a 64 bits value, because it will be
used in convert_to_conn_want_ext().
Signed-off-by: Luis Henriques <luis@igalia.com>
|