aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorLines
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.
2024-05-22--- (#951)dependabot[bot]-2/+2
updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-13Enable passthrough mode for read/write operations (#919)Amir Goldstein-6/+180
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>
2024-05-13Add in the libfuse version a program was compiled with (#942)Bernd Schubert-44/+268
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>
2024-05-10Handle NO_OPEN/NO_OPENDIR support automatically (#949)Josef Bacik-3/+26
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>
2024-05-07Bump actions/checkout from 4.1.4 to 4.1.5 (#946)dependabot[bot]-2/+2
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.4 to 4.1.5. - [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/0ad4b8fadaa221de15dcec353f45205ec38ea70b...44c2b7a8a4ea60a981eaca3cf939b5f4305c123b) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-07fuse_common.h: fix warning on _Static_assert() (#939)CismonX-1/+1
_Static_assert() is an ISO C11 feature. Make the check more standard-conformant so that the compiler won't give pedantic warnings.
2024-05-05Fix missing fuse_loop_cfg_destroy() in fuse_session_loop_mt_31 (#944)Bernd Schubert-1/+6
All credits to Miklos Szeredi <miklos@szeredi.hu> for spotting this. Signed-off-by: Bernd Schubert <bernd.schubert@fastmail.fm>
2024-04-30Bump actions/checkout from 4.1.3 to 4.1.4 (#943)dependabot[bot]-2/+2
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.3 to 4.1.4. - [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/1d96c772d19495a3b5c517cd2bc0cb401ea0529f...0ad4b8fadaa221de15dcec353f45205ec38ea70b) --- 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-04-27Use std=gnu11 (#940)Bernd Schubert-0/+1
We already have some C11 pieces like Static_assert and we are likely going to add more - tell meson to use C11. Plain C11 does not work as there are several language extension, like typeof - part of C23 only. We might be able to fix/workaround such extensions with compiler ifdef, but then I prefer gnu11 over checking which compiler is used (example gcc has __typeof vs clangs __typeof++). And compiler extension would also defeat pedantic.
2024-04-26Bump actions/checkout from 4.1.2 to 4.1.3 (#934)dependabot[bot]-2/+2
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.2 to 4.1.3. - [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/9bb56186c3b09b4f86b1c65136769dd318469633...1d96c772d19495a3b5c517cd2bc0cb401ea0529f) --- 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-04-25[libFuse 3.16.2]Compilation failure on freeBSD #936 (#938)Bernd Schubert-1/+1
Despite the creation of the header file fuse_config.h during LibFUSE version 3.16.2's Meson build process, the BSD mount_bsd.c file continues to reference config.h. Consequently, this discrepancy results in compilation failures. FIX : Point the mount_bsd.c to correct header.
2024-04-22 Use single place to define the version and increase version to 3.17.0 (#932)Bernd Schubert-7/+13
* 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>
2024-04-20example/: Convert all fuse_session_loop_mt users to 3.12 API (#931)Bernd Schubert-21/+36
Convert all the remaining users of fuse_session_loop_mt() to the new 3.12 config api.
2024-04-20passthrough_ll: fix fd leaks in lo_destroy() (#929)legezywzh-0/+1
By virtio-fs and libfuse fuse_custom_io, passthrough_ll could be a virtio filesystem device backend, this bug was found when doing mount, fsstress and umount repeatedly. Signed-off-by: Xiaoguang Wang <lege.wang@jaguarmicro.com> Co-authored-by: Xiaoguang Wang <lege.wang@jaguarmicro.com>
2024-04-18Add clone_fd to custom IO (#927)legezywzh-5/+25
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>
2024-04-16fix max_write update in do_init() (#926)legezywzh-3/+3
If user updates conn->max_write in fuse_lowlevel_ops' init() method, do_init() will miss the "conn.max_write > bufsize - FUSE_BUFFER_HEADER_SIZE" judgment, and ->init method will be called after it, which obviously is a bug. Signed-off-by: Xiaoguang Wang <lege.wang@jaguarmicro.com> Co-authored-by: Xiaoguang Wang <lege.wang@jaguarmicro.com>