aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorLines
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>
2025-03-19Fix a comment typo "passed to the filesystem.n"Bernd Schubert-1/+1
Closes: https://github.com/libfuse/libfuse/issues/1168 Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
2025-03-19Switch .dir-locals.el to linux kernel styleBernd Schubert-45/+62
We have a non ideal configuration for different editors. The project uses linux style - emacs config should also correspond to that. Taken from https://www.kernel.org/doc/html/v6.13/process/coding-style.html#you-ve-made-a-mess-of-it with the attempt to update for c++. Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
2025-03-18fusermount: prevent stdio FDs from being reusedBernd Schubert-28/+54
Redirect stdin/stdout/stderr to /dev/null to prevent newly opened file descriptors from reusing these low numbers (0,1,2) and potential issues with that. Signed-off-by: Bernd Schubert <bschubert@ddn.com>
2025-03-14fuse_lowlevel: Simplify se->buf_reallocableBernd Schubert-12/+18
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>
2025-03-14fuse_session_receive_buf: Fix the pipe buf sizeBernd Schubert-3/+13
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>
2025-03-14fuse_common.h: Convert back FUSE_CAP_ from enum to definesBernd Schubert-322/+315
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>
2025-03-13Add PanFS to whitelistjnr0006-0/+1
Added PanFSto whitelist. This should allow us to mount gocryptfs onto the parallel filesystem. Signed-off-by: Jacob Riley <jnr0006@uah.edu>
2025-03-11doc: Add new README about notification operationsLuis Henriques-0/+37
The main goal of this new file is to warn about the deadlocking risks when using the out-of-band notify operations while replying to other requests. Signed-off-by: Luis Henriques <luis@igalia.com>
2025-03-11build(deps): bump github/codeql-action from 3.28.9 to 3.28.11dependabot[bot]-2/+2
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.9 to 3.28.11. - [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/9e8d0789d4a0fa9ceb6b1738f7e269594bdd67f0...6bb031afdd8eb862ea3fc1848194185e076637e5) --- 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-11checkpatch: 100 chars per lineBernd Schubert-1/+1
Accept up to 100 chars per line to silence more github action updates. Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
2025-03-11checkpatch: More ignores: ENOSYS,FROM_SIGN_OFF_MISMATCH,QUOTED_COMMIT_IDBernd Schubert-1/+1
ENOSYS is right for fuse, automatic github action updates persistently run into sign-off-mismatch and commit-id quoting persistently conflicts with long line warnings. Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
2025-02-20fuse_log: simplify default log functionVassili Tchersky-42/+5
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>
2025-02-19mount: fix closing stdout/err and error logsVassili Tchersky-10/+11
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>
2025-02-19Update meson.build for master branch to 3.18Bernd Schubert-1/+1
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
2025-02-18github checkpatch test: Fix for non pull requestsBernd Schubert-5/+5
It should only run for pull requests. Indentation for the branch to run on was also not right. Signed-off-by: Bernd Schubert <bschubert@ddn.com>
2025-02-18github ci tests: Update the stable branch name to include fuse-Bernd Schubert-9/+15
The branch is actually called fuse-3.17.x Also disable checkpatch for branches except master, as it is to do basic checks, while stable branches do not need that check, assuming cherry-pick happens from master. Issue with it is that persistently complains about dependabot changes. Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
2025-02-18Fix a typo in test/ci-build.sh (ct vs cat)Bernd Schubert-1/+1
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
2025-02-18Avoid nested function declarations in helper functionsBernd Schubert-62/+28
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>
2025-02-18mount_bsd: Remove unused headersVassili Tchersky-4/+0
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>
2025-02-18mount_bsd: Show errors when syscalls failedVassili Tchersky-3/+7
Log on unmount() and close() failure Signed-off-by: Vassili Tchersky <vt+git@vbcy.org>
2025-02-18mount_bsd: Proper exit callsVassili Tchersky-4/+4
Use _exit() instead of exit() inside children Signed-off-by: Vassili Tchersky <vt+git@vbcy.org>
2025-02-18FreeBSD: Remove useless optionsVassili Tchersky-31/+6
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>
2025-02-18mount_bsd: Fix usage of libfuse_strtolVassili Tchersky-3/+4
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>
2025-02-18tests: Re-enable mknod and mkfifo tests on FreeBSDVassili Tchersky-6/+0
Signed-off-by: Vassili Tchersky <vt+git@vbcy.org>
2025-02-18tests: Disable tests with TMP_FILE on FreeBSDVassili Tchersky-0/+4
Not supported yet on this platform. See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=283179 Signed-off-by: Vassili Tchersky <vt+git@vbcy.org>
2025-02-17build(deps): bump github/codeql-action from 3.28.8 to 3.28.9dependabot[bot]-2/+2
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.8 to 3.28.9. - [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/dd746615b3b9d728a6a37ca2045b68ca76d4841a...9e8d0789d4a0fa9ceb6b1738f7e269594bdd67f0) --- 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-02-17Add comment for fuse_passthrough_open()Maksim Harbachou-0/+2
See https://github.com/libfuse/libfuse/issues/1125 Signed-off-by: Maksim Harbachou <maksim.harbachou@resilio.com>
2025-02-17ci-build test: Add a 32-bit compilation testBernd Schubert-1/+23
That was missing so far. Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
2025-02-17tests: Skip the ioctl test for x86 cross compilationBernd Schubert-0/+13
Probably some weird corner case in cross compilation, for now we ignore this. Signed-off-by: Bernd Schubert <bschubert@ddn.com>
2025-02-17example/hello_ll_uds: Switch to %zu and avoid 32bit build warningBernd Schubert-2/+2
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
2025-02-17fusermount: Exclude UFSD from whitelist for 32-bit buildsBernd Schubert-0/+2
The UFSD super magic is larger than 32-bit - I don't know if truncating to 32-bit would work - we just exclude it for now. Signed-off-by: Bernd Schubert <bschubert@ddn.com>
2025-02-17Fix build of example/memfs_ll.cc on 32 bit architecturesLaszlo Boszormenyi (GCS)-2/+2
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>
2025-02-13Add signify key for 3.18Bernd Schubert-0/+2
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>