aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorLines
2024-09-24Libfuse check ABI differences with 'abidiff'Bernd Schubert-0/+67
2024-09-23add version check for the fuse_loop_cfg* operationsyangyun-2/+13
fuse_loop_cfg* operations are introduced in fuse version 312 and can not be used in an early version. Also fix some typo.
2024-09-19passthrough_hp: Use fuse_loop_cfg_set_max_threads()Bernd Schubert-1/+1
fuse_loop_cfg_set_idle_threads() was by accident and setting it might cause a performance issue.
2024-09-16fusermount: Close file descriptors with close_range() if possibleBernd Schubert-1/+26
close_range() is much more efficient. Also remove the lower limit of 3 and set it to 0, as 0 to 1 might have been closed by the application and might be valid.
2024-09-16fusermount: close inherited fdsMJ Harvey-1/+19
When using the auto_unmount option, the fusermount3 watchdog process retains any inherited file descriptors. This PR ensures they are closed. Reason is that FDs that are kept open for a long time might cause issues for applications using libfuse, for example if these expect a pipe close, but the pipe is kept open through the inherited file descriptor. See for example: https://github.com/cvmfs/cvmfs/issues/3645 Signed-off-by: MJ Harvey <mharvey@jumptrading.com> Signed-off-by: Bernd Schubert <bschubert@ddn.com>
2024-09-13example/passthrough_hp: Set keep_cache and noflush in sfs_createBernd Schubert-2/+3
These flags should be also set for O_CREAT
2024-09-13example/passthrough_hp: No auto FOPEN_DIRECT_IO in passthrough modeBernd Schubert-22/+27
sfs_open and sfs_create set fi->direct_io (FOPEN_DIRECT_IO) when O_DIRECT is given, in order to benefit from a shared inode lock in kernel, i.e. to get parallel DIO writes. However, kernel side disabled passthrough when FOPEN_DIRECT_IO is set. Reads/writes had been totally failing in this case for O_DIRECT as sfs_write_buf() and sfs_read() have a sanity check. That sanity check could be modified, but for performance passthrough is better than parallel DIO, hence, we only want automatic FOPEN_DIRECT_IO for O_DIRECT when passthrough is not enabled. Fixes: https://github.com/libfuse/libfuse/issues/1027 This also fixes automatically switching to FOPEN_DIRECT_IO for O_DIRECT in sfs_create().
2024-09-12getattr: Make use of FUSE_GETATTR_FH in lowlevel examplesBernd Schubert-7/+8
High level examples were already using it, but not lowlevel. Also update the documentation.
2024-09-05Bump codespell-project/actions-codespell from 2.0 to 2.1dependabot[bot]-1/+1
Bumps [codespell-project/actions-codespell](https://github.com/codespell-project/actions-codespell) from 2.0 to 2.1. - [Release notes](https://github.com/codespell-project/actions-codespell/releases) - [Commits](https://github.com/codespell-project/actions-codespell/compare/94259cd8be02ad2903ba34a22d9c13de21a74461...406322ec52dd7b488e48c1c4b82e2a8b3a1bf630) --- updated-dependencies: - dependency-name: codespell-project/actions-codespell dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
2024-08-26remove unused headers in example/poll_clientyangyun-1/+0
fuse_config.h is used in libfuse internally. This may confuse developers that fuse_config.h is used in the examples.
2024-08-21Rearrange util/fusermount.c umount_fuse_locked() so thatNorman Wilson-2/+4
umount2 is called with privs dropped, not raised. This works around a clash with NFS permissions: if FUSE mounted on NFS client directory with root_squash in effect, and some directory in the path leading to the mount point denies permissions to others, umount2 will fail because userid 0 cannot search it. Since drop_privs merely sets the file- system user- and group-ID without changing the CAP_SYS_ADMIN capability needed to unmount a file system (which fusermount has because it is set-user-ID root), umount2 works fine.
2024-08-19Fix FUSE_USE_VERSION in example/notify_store_retrieve.cyangyun-1/+1
This is an addition to commit e75d2c54a347. This example sets FUSE_USE_VERSION = 34 but uses fuse_loop_cfg_* APIs, which is not allowed since these APIs are not introduced in version 34.
2024-08-07doc/libfuse-operations: Fix FUSE_STATX in_args[1] descriptionJoanne Koong-1/+1
2024-08-02Fix program-path in util/parse-backtrace and dump_stack functionBernd Schubert-4/+4
The option to the path of the binary had been accidentally removed in the scripts that can parse backtraces. The dump_stack() function had left over debug messages.
2024-08-01example/passthrough_hp: Remove unused includesBernd Schubert-4/+0
Fix some clang-tidy warnings. Signed-off-by: Bernd Schubert <bschubert@ddn.com>
2024-08-01Fix FUSE_USE_VERSION in example/Bernd Schubert-3/+3
This is an addition to commit a8f1ae35af66, which introduced the 312 API, but didn't set the right API version in all examples. Signed-off-by: Bernd Schubert <bschubert@ddn.com>
2024-08-01synchronize fuse_kernel.h with linux-6.10Bernd Schubert-1/+17
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
2024-07-30example/passthrough_hp: Fix . and .. readdir lookup countBernd Schubert-5/+7
Commit 170edc6a8ef0 added dot and dotdot (. and ..) to readdir results, but introduced an issue when max number of entries was reached - lookup count must not be decreased without doing the lookup. With ext4 as underlying file system readir seems to return . and .. at random offsets and randomly failed xfstests for me. This also fixes indentation, as passthrough_hp.cc does not follow the linux indentation style (if we decide to fix this, it needs to be done for the entire file). Signed-off-by: Bernd Schubert <bschubert@ddn.com>
2024-07-30Add a script to parse backtracesBernd Schubert-0/+114
2024-07-29Add MS_NOSYMFOLLOW compat definitionBernd Schubert-1/+8
After commit 54466d2c426b compilation was failing on my debian VM.
2024-07-29Pass through nosymfollow mount optionTyler Hall-0/+7
This option is handled in VFS. Added in Linux 5.10 dab741e0e02bd3c4f5e2e97be74b39df2523fc6e Signed-off-by: Tyler Hall <tylerwhall@gmail.com>
2024-07-29Gate #include <execinfo.h> behind #ifdef HAVE_BACKTRACENils-1/+4
execinfo.h is unnecessary if HAVE_BACKTRACE is not defined. This increases portability for systems without execinfo.h
2024-07-17fuse_log: initialize sys_log_level variable to avoid compiler warningJoanne Koong-2/+2
2024-07-14Add RAMFS to fusermount permitted mount targetsBernd Schubert-0/+1
Addresses issue https://github.com/libfuse/libfuse/issues/982
2024-07-14Add syslog and fatal signal handler featureBernd Schubert-32/+229
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.
2024-07-09xfstests: Add '-odev' to passthrough mount optionsBernd Schubert-1/+1
generic/434 and generic/184 are testing device files and fail because fuse sets 'nodev' by default.
2024-07-08passthrough_hp: include . and .. in readdirJoanne Koong-5/+10
generic/401 fails currently because it checks that "." and ".." are listed as directory entries. Include "." and ".." as listed directory entries in passthrough_hp's readdir implementation. Signed-off by: Joanne Koong <joannelkoong@gmail.com>
2024-07-08example/notify_inval_entry.c: improve comment readabilitydesertwitch-2/+2
Follow the same format as other arguments passed to example commands.
2024-07-08example/notify_inval_entry.c: fix example command in commentsdesertwitch-1/+1
Notifications should be enabled here, but present command example would disable them.
2024-07-03Add list of libfuse (kernel) operationsBernd Schubert-0/+418
This is to document operations and to also list their in/out arguments. This list was auto generated and only partly verified, use with care. Not all operations are supported by libfuse yet.
2024-07-03Annotate ABI sensitivness for some data structuresBernd Schubert-5/+16
These are not all ABI sensitive data structures yet. Also some space vs tab indentation issues are corrected.
2024-07-03high-level: add fmask and dmask optionsgandalfs_cat-5/+27
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.
2024-06-25Add nullptr check in fuse_session_mountBernd Schubert-0/+10
The pointer did not have any sanity check. Addresses https://github.com/libfuse/libfuse/issues/979
2024-06-25Use off_t instead of loff_tCismonX-3/+1
Since we're already enforcing 64-bit off_t, using loff_t makes no difference. Also loff_t is Linux-only, which breaks compatibility for *BSD.
2024-06-25Fix wrong use of the EBADFD errnoCismonX-5/+5
should use EBADF instead
2024-06-25Do not build the hello_ll_uds example for *BSDCismonX-2/+2
since there's no splice(2) support
2024-06-22Update AUTHORStrapexit-1/+1
Co-authored-by: Ashley Pittman <ashley@pittman.co.uk>
2024-06-22Update AUTHORSAntonio SJ Musumeci-2/+5
2024-06-19Bump actions/checkout from 4.1.6 to 4.1.7dependabot[bot]-2/+2
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.6 to 4.1.7. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/a5ac7e51b41094c92402da3b24376905380afc29...692973e3d937129bcbf40652eb9f2f61becf3332) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
2024-06-13libfuse: null-terminate buffer in fuse_req_getgroups()Miklos Szeredi-0/+1
After reading the file /proc/$PID/task/$PID/status the buffer wasn't terminated with a null character. This could theoretically lead to buffer overrun by the subsequent strstr() call. Since the contents of the proc file are guaranteed to contain the pattern that strstr is looking for, this doesn't happen in normal situations. Add null termination for robustness. Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
2024-06-11fix useless fuse_init_intr_signal in high-level apiyangyun-10/+9
The code `fuse_init_intr_signal` in `_fuse_new_317` is useless since commit 8ee553dac ("fuse_new(): don't accept options that don't make sense for end-users") has remove the conf.intr option for end-users. The conf.intr is always zero (i.e., disabled) here. Move `fuse_init_intr_signal` after the user-defined `init()` function, so that conf.intr and conf.intr_signal has been configured by the user.
2024-06-07libfuse: have passthrough_hp return an error with invalid mount optionsJosef Bacik-0/+1
generic/003 fails currently because if you specify -o relatime we will fail to mount, but not return an error, so the test thinks that we support relatime and then hilarity ensues. Set ret so that if we get any failures while trying to mount we will properly error out. Signed-off-by: Josef Bacik <josef@toxicpanda.com>
2024-06-07xfstests: Add the possibility for extra daemon options (#964)Bernd Schubert-1/+6
We need to test w/o page cache, w/o passthrough and other options. I.e. we need to have the possibility to add these options via local.config
2024-06-04Merge pull request #957 from bsbernd/fuse-req-atomic-ref-cntBernd Schubert-12/+12
Atomic struct fuse_req::ref_cnt
2024-06-04Rename struct fuse_req::ctr to ::ref_cntBernd Schubert-12/+12
ref_cnt should make the intention of this variable more clear.
2024-06-04Make struct fuse_req::ctr a C11 _AtomicBernd Schubert-1/+1
The variable is not modified exclusively with locks since commit cef8c8b24902 ("Add support for no_interrupt") anymore. That commit is safe, but might be error prone to future updates. Changing it to a C11 _Atomic should avoid issues.
2024-06-04Add support for no_interrupt (#956)yangyun50-10/+93
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.
2024-06-01Fix compatibility issue around fuse_custom_io->clone_fd (#953)legezywzh-8/+59
Fixes: 73cd124d0408 ("Add clone_fd to custom IO (#927)") Signed-off-by: Xiaoguang Wang <lege.wang@jaguarmicro.com>
2024-05-27Remove most includes in compat.c (#954)Bernd Schubert-15/+6
compat.c is supposed to be standalone to provide compat ABI symbols. Including fuse header files can cause conflicts - just the opposite of what compat.c was made for.
2024-05-27Add a .clang-format file (#952)Bernd Schubert-0/+119
This is direct copy of <linux>/.clang-format as this project was initiated with linux style. Some lines that were auto-generated are removed ("# Taken from:...). Some files like example/passthrough_hp.cc use a different style - these files probably should be cleaned up when major changes are done to them.