aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorLines
2025-05-19build(deps): bump github/codeql-action from 3.28.16 to 3.28.17dependabot[bot]-2/+2
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.16 to 3.28.17. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/28deaeda66b76a05916b6923827895f2b14ab387...60168efe1c415ce0f5521ea06d5c2062adbeed1b) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 3.28.17 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
2025-04-30Support request timeoutsJoanne Koong-1/+12
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>
2025-04-30Update include/fuse_kernel.h to version 7.43Joanne Koong-2/+8
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>
2025-04-29fuse_lowlevel.c: Fix a small spelling mistakeizxl007-1/+1
Signed-off-by: izxl007 <zeng.zheng@zte.com.cn>
2025-04-29build(deps): bump github/codeql-action from 3.28.15 to 3.28.16dependabot[bot]-2/+2
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.15 to 3.28.16. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/45775bd8235c68ba998cffa5171334d58593da47...28deaeda66b76a05916b6923827895f2b14ab387) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 3.28.16 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
2025-04-28lib/fuse.c: refactor handler logic for readabilityJoanne Koong-450/+399
Refactor handler logic to make it more readable. No functional changes. Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
2025-04-28Add a README for fuse-over-io-uringBernd Schubert-2/+39
Also update the comment description of fuse_uring.c Signed-off-by: Bernd Schubert <bschubert@ddn.com>
2025-04-28Set FUSE_CAP_OVER_IO_URING flag - allow io-uring modeBernd Schubert-0/+3
So far it was disabled as the series was not complete yet. Signed-off-by: Bernd Schubert <bschubert@ddn.com>
2025-04-28env variables to override default io-uring enable and q-depthBernd Schubert-2/+18
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>
2025-04-28passthrough_hp: Add io-uring optionsBernd Schubert-4/+25
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
2025-04-28Add fuse_req_is_uring() to check if a req comes through io-uringBernd Schubert-0/+15
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>
2025-04-28fuse: Add io-uring optionsBernd Schubert-2/+18
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
2025-04-28fuse_common.h: Prefix flags with 1ULBernd Schubert-29/+29
Ensure it is correctly stored in an unsigned 32 bit int. Signed-off-by: Bernd Schubert <bschubert@ddn.com>
2025-04-28Add fuse-io-uring reply supportBernd Schubert-27/+222
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
2025-04-28Add fuse_session_process_uring_cqeBernd Schubert-37/+111
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
2025-04-28Add a basic io-uring cqe handlerBernd Schubert-3/+92
Not function yet, just preparation. Signed-off-by: Bernd Schubert <bschubert@ddn.com>
2025-04-28fuse_ll_ops: Make fuse_ino_t constBernd Schubert-1/+1
It will never be modified, should be const. Signed-off-by: Bernd Schubert <bschubert@ddn.com>
2025-04-28fuse_lowlevel: Split fuse_send_msgBernd Schubert-19/+32
The actual function to write to /dev/fuse is offloaded into _fuse_send_msg() Signed-off-by: Bernd Schubert <bschubert@ddn.com>
2025-04-28Add support for ring creation in fuse_lowlevel.cBernd Schubert-3/+63
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
2025-04-28fuse: Add ring creationBernd Schubert-3/+630
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
2025-04-28Add a fuse_set_thread_name() helperBernd Schubert-7/+23
Avoid splattering the code with ifdef Signed-off-by: Bernd Schubert <bschubert@ddn.com>
2025-04-28Add container_of and ROUND_UP macrosBernd Schubert-8/+6
Needed by follow up commits. container_of is actually just moved/consolidated to util.h. Signed-off-by: Bernd Schubert <bschubert@ddn.com>
2025-04-28fuse_lowlevel: Add support for header/payload separationBernd Schubert-171/+608
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>
2025-04-28Synchronize fuse_kernel.h with linux-6.14Bernd Schubert-2/+101
Also add FUSE_CAP_OVER_IO_URING Signed-off-by: Bernd Schubert <bschubert@ddn.com>
2025-04-28Add fuse-io-uring dependencies to github workfow filesBernd Schubert-3/+4
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
2025-04-26meson.build: make special_funcs check more reliableGiulio Benetti-2/+2
Unfortunately while cross-compiling with build tools like Buildroot it happens to have repeated flags or anything that could lead to a warning. This way the check fails because of a warning not related to the special function. So let's use cc.links() and increase minimum meson_version to 0.60 since cc.links() has been added during that version. Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
2025-04-25Fix meson function testsBernd Schubert-18/+49
Several meson tests were incorrectly failing Checking for function "static_assert" : NO (cached) Checking for function "pthread_setname_np" : NO (cached) Check usable header "#include <linux/close_range.h>" : NO (cached) These functions get now tested with compilation tests and get found on my system. Checking if "static_assert check" compiles: YES Checking if "pthread_setname_np check" compiles: YES Checking if "close_range check" compiles: YES Signed-off-by: Bernd Schubert <bschubert@ddn.com>
2025-04-24Fix test/test_examples.py::test_passthroughBernd Schubert-6/+51
The test had multiple issues - default passthrough_ll timeout was used - the created file was then not listed if timeout was not passed yet - mnt_name was actually point to src_dir, file comparison of stat, etc succeeded, because the same file was compared. Switching to the right dir made stat to always fail, because st_dev is different for source and mount. I.e. the test must not compare all stat values. Not sure how this test ever passed, but in a very slow debug VM with lots of kernel debug options enabled, the default passthrough_ll timeout it systematically failed. Signed-off-by: Bernd Schubert <bschubert@ddn.com>
2025-04-24Fix multi-threaded fuse session exitBernd Schubert-39/+277
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>
2025-04-23signal handlers: Store fuse_session unconditionallyBernd Schubert-4/+9
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>
2025-04-23example: fix memfs_rename deadlock errorswj-4/+5
Signed-off-by: swj <1186093704@qq.com>
2025-04-23Check if pthread_setname_np() exists before use itGiulio Benetti-1/+6
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>
2025-04-16conn: prevent duplicate flag conversion in high-level interfaceBernd Schubert-15/+215
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>
2025-04-15mount: Add FUSE_KERN_DEVICE env variable to specify fuse kernel deviceMeng Lu Wang-42/+19
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>
2025-04-09lib: remove second fuse_main_real_versioned declarationBen Dooks-3/+0
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>
2025-04-08build(deps): bump github/codeql-action from 3.28.13 to 3.28.15dependabot[bot]-2/+2
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.13 to 3.28.15. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/1b549b9259bda1cb5ddde3b41741a82a2d15a841...45775bd8235c68ba998cffa5171334d58593da47) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 3.28.15 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
2025-04-07fuse_lowlevel: Set bufsize if HAVE_SPLICE is not define and avoid raceBernd Schubert-6/+13
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>
2025-04-04meson: add option for enabling usdtJoanne Koong-1/+30
Default is having usdt disabled. Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
2025-04-04Fix static_assert build failure with C++ version < 11Giulio Benetti-4/+2
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>
2025-04-02Fix build with kernel < 5.9Giulio Benetti-3/+7
linux/close_range.h is only available since kernel 5.9 and https://github.com/torvalds/linux/commit/60997c3d45d9a67daf01c56d805ae4fec37e0bd8 resulting in the following build failure: ../util/fusermount.c:40:10: fatal error: linux/close_range.h: No such file or directory So let's check for header presence and emit HAVE_LINUX_CLOSE_RANGE_H accordingly and check for it when including <linux/close_range.h> and calling close_range() instead of checking for close_range() function in meson and check against HAVE_CLOSE_RANGE. Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
2025-04-02example: add usdt.btJoanne Koong-0/+19
Add example bpftrace file for monitoring tracepoints. Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
2025-04-02fuse_lowlevel: add tracepoints for request receiving, processing, and replyingJoanne Koong-0/+23
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>
2025-04-02lib: Add usdt.hJoanne Koong-0/+540
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>
2025-03-27example: Add a compilation instruction in README.compileizxl007-0/+4
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>
2025-03-26example/hello_ll.c: Improve the compilation commentsizxl007-0/+4
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>
2025-03-25build(deps): bump github/codeql-action from 3.28.11 to 3.28.13dependabot[bot]-2/+2
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.11 to 3.28.13. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/6bb031afdd8eb862ea3fc1848194185e076637e5...1b549b9259bda1cb5ddde3b41741a82a2d15a841) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
2025-03-25checkpatch: Ignore dependabot commitsBernd Schubert-0/+5
Thes commits have the habit to persistently fail, mostly with long lines. We don't have control over these commits, so let's ignore them. Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
2025-03-24fuse: Fix want flag conversionBernd Schubert-31/+265
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>
2025-03-24test/test_write_cache.c: Reformat with clang-formatBernd Schubert-204/+212
The file is going to be updated - should be more conform Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
2025-03-24convert LL_ENABLE/LL_DISABLE to do-while-loopBernd Schubert-4/+11
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>