qemu-gpiodev/libfuse.git
6 months agogetattr: Make use of FUSE_GETATTR_FH in lowlevel examples
Bernd Schubert [Mon, 26 Aug 2024 17:33:47 +0000 (19:33 +0200)]
getattr: Make use of FUSE_GETATTR_FH in lowlevel examples

High level examples were already using it, but not
lowlevel. Also update the documentation.

6 months agoBump codespell-project/actions-codespell from 2.0 to 2.1
dependabot[bot] [Mon, 19 Aug 2024 22:49:43 +0000 (22:49 +0000)]
Bump codespell-project/actions-codespell from 2.0 to 2.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>
7 months agoremove unused headers in example/poll_client
yangyun [Tue, 20 Aug 2024 11:28:23 +0000 (19:28 +0800)]
remove unused headers in example/poll_client

fuse_config.h is used in libfuse internally. This may confuse developers
that fuse_config.h is used in the examples.

7 months agoRearrange util/fusermount.c umount_fuse_locked() so that
Norman Wilson [Mon, 12 Aug 2024 18:16:30 +0000 (14:16 -0400)]
Rearrange util/fusermount.c umount_fuse_locked() so that
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.

7 months agoFix FUSE_USE_VERSION in example/notify_store_retrieve.c
yangyun [Mon, 19 Aug 2024 10:29:23 +0000 (18:29 +0800)]
Fix FUSE_USE_VERSION in example/notify_store_retrieve.c

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.

7 months agodoc/libfuse-operations: Fix FUSE_STATX in_args[1] description
Joanne Koong [Tue, 6 Aug 2024 22:14:04 +0000 (15:14 -0700)]
doc/libfuse-operations: Fix FUSE_STATX in_args[1] description

7 months agoFix program-path in util/parse-backtrace and dump_stack function
Bernd Schubert [Wed, 31 Jul 2024 20:29:54 +0000 (22:29 +0200)]
Fix program-path in util/parse-backtrace and dump_stack function

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.

8 months agoexample/passthrough_hp: Remove unused includes
Bernd Schubert [Tue, 30 Jul 2024 12:43:06 +0000 (14:43 +0200)]
example/passthrough_hp: Remove unused includes

Fix some clang-tidy warnings.

Signed-off-by: Bernd Schubert <bschubert@ddn.com>
8 months agoFix FUSE_USE_VERSION in example/
Bernd Schubert [Tue, 2 Jul 2024 15:37:50 +0000 (17:37 +0200)]
Fix FUSE_USE_VERSION in example/

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>
8 months agosynchronize fuse_kernel.h with linux-6.10
Bernd Schubert [Tue, 2 Jul 2024 15:34:52 +0000 (17:34 +0200)]
synchronize fuse_kernel.h with linux-6.10

Signed-off-by: Bernd Schubert <bschubert@ddn.com>
8 months agoexample/passthrough_hp: Fix . and .. readdir lookup count
Bernd Schubert [Mon, 29 Jul 2024 23:13:27 +0000 (01:13 +0200)]
example/passthrough_hp: Fix . and .. readdir lookup count

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>
8 months agoAdd a script to parse backtraces
Bernd Schubert [Mon, 29 Jul 2024 19:57:56 +0000 (21:57 +0200)]
Add a script to parse backtraces

8 months agoAdd MS_NOSYMFOLLOW compat definition
Bernd Schubert [Mon, 29 Jul 2024 17:56:47 +0000 (19:56 +0200)]
Add MS_NOSYMFOLLOW compat definition

After commit 54466d2c426b compilation was failing on my debian VM.

8 months agoPass through nosymfollow mount option
Tyler Hall [Sat, 27 Jul 2024 02:49:29 +0000 (22:49 -0400)]
Pass through nosymfollow mount option

This option is handled in VFS.

Added in Linux 5.10
dab741e0e02bd3c4f5e2e97be74b39df2523fc6e

Signed-off-by: Tyler Hall <tylerwhall@gmail.com>
8 months agoGate #include <execinfo.h> behind #ifdef HAVE_BACKTRACE
Nils [Tue, 23 Jul 2024 02:13:05 +0000 (03:13 +0100)]
Gate #include <execinfo.h> behind #ifdef HAVE_BACKTRACE

execinfo.h is unnecessary if HAVE_BACKTRACE is not defined.
This increases portability for systems without execinfo.h

8 months agofuse_log: initialize sys_log_level variable to avoid compiler warning
Joanne Koong [Tue, 16 Jul 2024 19:57:59 +0000 (12:57 -0700)]
fuse_log: initialize sys_log_level variable to avoid compiler warning

8 months agoAdd RAMFS to fusermount permitted mount targets
Bernd Schubert [Sun, 14 Jul 2024 12:33:18 +0000 (14:33 +0200)]
Add RAMFS to fusermount permitted mount targets

Addresses issue https://github.com/libfuse/libfuse/issues/982

8 months agoAdd syslog and fatal signal handler feature
Bernd Schubert [Wed, 10 Jul 2024 21:04:46 +0000 (23:04 +0200)]
Add syslog and fatal signal handler feature

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.

8 months agoxfstests: Add '-odev' to passthrough mount options
Bernd Schubert [Tue, 9 Jul 2024 08:25:27 +0000 (10:25 +0200)]
xfstests: Add '-odev' to passthrough mount options

generic/434 and generic/184 are testing device files and fail
because fuse sets 'nodev' by default.

8 months agopassthrough_hp: include . and .. in readdir
Joanne Koong [Fri, 5 Jul 2024 21:54:15 +0000 (14:54 -0700)]
passthrough_hp: include . and .. in readdir

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>

8 months agoexample/notify_inval_entry.c: improve comment readability
desertwitch [Thu, 4 Jul 2024 15:57:25 +0000 (17:57 +0200)]
example/notify_inval_entry.c: improve comment readability

Follow the same format as other arguments passed to example commands.

8 months agoexample/notify_inval_entry.c: fix example command in comments
desertwitch [Thu, 4 Jul 2024 15:55:36 +0000 (17:55 +0200)]
example/notify_inval_entry.c: fix example command in comments

Notifications should be enabled here, but present command example would disable them.

8 months agoAdd list of libfuse (kernel) operations
Bernd Schubert [Thu, 20 Jun 2024 12:32:54 +0000 (14:32 +0200)]
Add list of libfuse (kernel) operations

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.

8 months agoAnnotate ABI sensitivness for some data structures
Bernd Schubert [Tue, 25 Jun 2024 03:42:21 +0000 (05:42 +0200)]
Annotate ABI sensitivness for some data structures

These are not all ABI sensitive data structures yet.

Also some space vs tab indentation issues are corrected.

8 months agohigh-level: add fmask and dmask options
gandalfs_cat [Sun, 23 Jun 2024 11:28:30 +0000 (04:28 -0700)]
high-level: add fmask and dmask options

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.

9 months agoAdd nullptr check in fuse_session_mount
Bernd Schubert [Tue, 25 Jun 2024 05:05:19 +0000 (07:05 +0200)]
Add nullptr check in fuse_session_mount

The pointer did not have any sanity check.

Addresses https://github.com/libfuse/libfuse/issues/979

9 months agoUse off_t instead of loff_t
CismonX [Thu, 20 Jun 2024 20:40:51 +0000 (04:40 +0800)]
Use off_t instead of loff_t

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.

9 months agoFix wrong use of the EBADFD errno
CismonX [Thu, 20 Jun 2024 20:36:47 +0000 (04:36 +0800)]
Fix wrong use of the EBADFD errno

should use EBADF instead

9 months agoDo not build the hello_ll_uds example for *BSD
CismonX [Thu, 20 Jun 2024 20:12:29 +0000 (04:12 +0800)]
Do not build the hello_ll_uds example for *BSD

since there's no splice(2) support

9 months agoUpdate AUTHORS
trapexit [Fri, 21 Jun 2024 19:08:50 +0000 (14:08 -0500)]
Update AUTHORS

Co-authored-by: Ashley Pittman <ashley@pittman.co.uk>
9 months agoUpdate AUTHORS
Antonio SJ Musumeci [Fri, 21 Jun 2024 18:20:24 +0000 (13:20 -0500)]
Update AUTHORS

9 months agoBump actions/checkout from 4.1.6 to 4.1.7
dependabot[bot] [Mon, 17 Jun 2024 22:42:54 +0000 (22:42 +0000)]
Bump actions/checkout from 4.1.6 to 4.1.7

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>
9 months agolibfuse: null-terminate buffer in fuse_req_getgroups()
Miklos Szeredi [Thu, 13 Jun 2024 11:57:25 +0000 (13:57 +0200)]
libfuse: null-terminate buffer in fuse_req_getgroups()

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>
9 months agofix useless fuse_init_intr_signal in high-level api
yangyun [Tue, 4 Jun 2024 12:57:14 +0000 (20:57 +0800)]
fix useless fuse_init_intr_signal in high-level api

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.

9 months agolibfuse: have passthrough_hp return an error with invalid mount options
Josef Bacik [Fri, 7 Jun 2024 18:49:10 +0000 (14:49 -0400)]
libfuse: have passthrough_hp return an error with invalid mount options

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>
9 months agoxfstests: Add the possibility for extra daemon options (#964)
Bernd Schubert [Fri, 7 Jun 2024 19:31:28 +0000 (21:31 +0200)]
xfstests: Add the possibility for extra daemon options (#964)

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

9 months agoMerge pull request #957 from bsbernd/fuse-req-atomic-ref-cnt
Bernd Schubert [Tue, 4 Jun 2024 12:44:51 +0000 (14:44 +0200)]
Merge pull request #957 from bsbernd/fuse-req-atomic-ref-cnt

Atomic struct fuse_req::ref_cnt

9 months agoRename struct fuse_req::ctr to ::ref_cnt
Bernd Schubert [Tue, 4 Jun 2024 12:00:07 +0000 (14:00 +0200)]
Rename struct fuse_req::ctr to ::ref_cnt

ref_cnt should make the intention of this variable more clear.

9 months agoMake struct fuse_req::ctr a C11 _Atomic
Bernd Schubert [Tue, 4 Jun 2024 11:56:09 +0000 (13:56 +0200)]
Make struct fuse_req::ctr a C11 _Atomic

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.

9 months agoAdd support for no_interrupt (#956)
yangyun50 [Tue, 4 Jun 2024 11:50:48 +0000 (19:50 +0800)]
Add support for no_interrupt (#956)

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.

10 months agoFix compatibility issue around fuse_custom_io->clone_fd (#953)
legezywzh [Sat, 1 Jun 2024 21:18:35 +0000 (05:18 +0800)]
Fix compatibility issue around fuse_custom_io->clone_fd (#953)

Fixes: 73cd124d0408 ("Add clone_fd to custom IO (#927)")
Signed-off-by: Xiaoguang Wang <lege.wang@jaguarmicro.com>
10 months agoRemove most includes in compat.c (#954)
Bernd Schubert [Mon, 27 May 2024 13:24:10 +0000 (15:24 +0200)]
Remove most includes in compat.c (#954)

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.

10 months agoAdd a .clang-format file (#952)
Bernd Schubert [Mon, 27 May 2024 08:18:19 +0000 (10:18 +0200)]
Add a .clang-format file (#952)

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.

10 months ago--- (#951)
dependabot[bot] [Wed, 22 May 2024 18:53:49 +0000 (20:53 +0200)]
--- (#951)

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>
10 months agoEnable passthrough mode for read/write operations (#919)
Amir Goldstein [Mon, 13 May 2024 13:30:25 +0000 (16:30 +0300)]
Enable passthrough mode for read/write operations (#919)

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>
10 months agoAdd in the libfuse version a program was compiled with (#942)
Bernd Schubert [Mon, 13 May 2024 10:32:06 +0000 (12:32 +0200)]
Add in the libfuse version a program was compiled with (#942)

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>
10 months agoHandle NO_OPEN/NO_OPENDIR support automatically (#949)
Josef Bacik [Fri, 10 May 2024 15:52:20 +0000 (11:52 -0400)]
Handle NO_OPEN/NO_OPENDIR support automatically (#949)

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>
10 months agoBump actions/checkout from 4.1.4 to 4.1.5 (#946)
dependabot[bot] [Tue, 7 May 2024 18:16:48 +0000 (20:16 +0200)]
Bump actions/checkout from 4.1.4 to 4.1.5 (#946)

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>
10 months agofuse_common.h: fix warning on _Static_assert() (#939)
CismonX [Tue, 7 May 2024 11:22:59 +0000 (11:22 +0000)]
fuse_common.h: fix warning on _Static_assert() (#939)

_Static_assert() is an ISO C11 feature.  Make the check more
standard-conformant so that the compiler won't give pedantic warnings.

10 months agoFix missing fuse_loop_cfg_destroy() in fuse_session_loop_mt_31 (#944)
Bernd Schubert [Sun, 5 May 2024 11:09:56 +0000 (13:09 +0200)]
Fix missing fuse_loop_cfg_destroy() in fuse_session_loop_mt_31 (#944)

All credits to Miklos Szeredi <miklos@szeredi.hu> for spotting
this.

Signed-off-by: Bernd Schubert <bernd.schubert@fastmail.fm>
11 months agoBump actions/checkout from 4.1.3 to 4.1.4 (#943)
dependabot[bot] [Tue, 30 Apr 2024 08:05:33 +0000 (10:05 +0200)]
Bump actions/checkout from 4.1.3 to 4.1.4 (#943)

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>
11 months agoUse std=gnu11 (#940)
Bernd Schubert [Sat, 27 Apr 2024 12:25:48 +0000 (14:25 +0200)]
Use std=gnu11 (#940)

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.

11 months agoBump actions/checkout from 4.1.2 to 4.1.3 (#934)
dependabot[bot] [Fri, 26 Apr 2024 12:19:16 +0000 (14:19 +0200)]
Bump actions/checkout from 4.1.2 to 4.1.3 (#934)

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>
11 months ago[libFuse 3.16.2]Compilation failure on freeBSD #936 (#938)
Bernd Schubert [Thu, 25 Apr 2024 15:09:05 +0000 (17:09 +0200)]
[libFuse 3.16.2]Compilation failure on freeBSD #936 (#938)

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.

11 months ago Use single place to define the version and increase version to 3.17.0 (#932)
Bernd Schubert [Mon, 22 Apr 2024 10:05:39 +0000 (12:05 +0200)]
 Use single place to define the version and increase version to 3.17.0 (#932)

* 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>
11 months agoexample/: Convert all fuse_session_loop_mt users to 3.12 API (#931)
Bernd Schubert [Sat, 20 Apr 2024 20:56:13 +0000 (22:56 +0200)]
example/: Convert all fuse_session_loop_mt users to 3.12 API (#931)

Convert all the remaining users of fuse_session_loop_mt() to
the new 3.12 config api.

11 months agopassthrough_ll: fix fd leaks in lo_destroy() (#929)
legezywzh [Sat, 20 Apr 2024 11:40:16 +0000 (19:40 +0800)]
passthrough_ll: fix fd leaks in lo_destroy() (#929)

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>
11 months agoAdd clone_fd to custom IO (#927)
legezywzh [Thu, 18 Apr 2024 09:29:35 +0000 (17:29 +0800)]
Add clone_fd to custom IO (#927)

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>
11 months agofix max_write update in do_init() (#926)
legezywzh [Tue, 16 Apr 2024 15:23:57 +0000 (23:23 +0800)]
fix max_write update in do_init() (#926)

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>
11 months agofusermount: Fix use of uninitialized x_mnt_opts (#924)
Bernd Schubert [Sat, 6 Apr 2024 13:19:33 +0000 (15:19 +0200)]
fusermount: Fix use of uninitialized x_mnt_opts (#924)

x_mnt_opts was not initialized to 0, but strncat was done

Spotted by cppcheck running on our ddn branch.

11 months agoAdd more documentation for FUSE_CAP_EXPORT_SUPPORT (#917)
Bernd Schubert [Tue, 2 Apr 2024 21:52:18 +0000 (23:52 +0200)]
Add more documentation for FUSE_CAP_EXPORT_SUPPORT (#917)

Add more documentation for FUSE_CAP_EXPORT_SUPPORT

Also remove the flag from passthrough_ll.c and passthrough_hp.cc
as these implementations do _not_ handle that flag. They just
cast fuse_ino_t to an inode and cause a heap buffer overflow
for unknown objects (simplest reproducer are the examples
in "man 2 open_by_handle_at", but to unmount/mount the file
system after name_to_handle_at and before open_by_handle_at).

Fixes https://github.com/libfuse/libfuse/issues/838

---------

Co-authored-by: Nikolaus Rath <Nikolaus@rath.org>
12 months agoAdd support for FUSE_CAP_HANDLE_KILLPRIV_V2
Bernd Schubert [Thu, 28 Mar 2024 14:18:14 +0000 (15:18 +0100)]
Add support for FUSE_CAP_HANDLE_KILLPRIV_V2

This just adds in the basic handler, but does not
use it yet in examples.

12 months agoFix FUSE_CAP_DIRECT_IO_ALLOW_MMAP - use new numerical value
Bernd Schubert [Wed, 27 Mar 2024 19:23:12 +0000 (20:23 +0100)]
Fix FUSE_CAP_DIRECT_IO_ALLOW_MMAP - use new numerical value

Commit 22741f5  accidentally re-used (1 << 27), which is
already taken for FUSE_CAP_SETXATTR_EXT.

Fortunately not part of any release yet.

12 months agoInstall all test/build python packages from requirements.txt
Ashley Pittman [Sat, 23 Mar 2024 19:50:59 +0000 (19:50 +0000)]
Install all test/build python packages from requirements.txt

Have GitHub actions setup python on runners and install
all python dependencies via pip.

Signed-off-by: Ashley Pittman <ashley@pittman.co.uk>
12 months agofix readdirplus when filler is called with zero offset (#896)
farlongsignal [Sun, 24 Mar 2024 20:54:19 +0000 (21:54 +0100)]
fix readdirplus when filler is called with zero offset (#896)

fixes #235

In fill_dir_plus(), there's a lookup for caching dirent attributes.
However, when offset = 0 the cache metadata from the lookup is lost
as only the entry attributes are passed when added to the list. Kernel
doesn't cache the attributes since .ino = 0.

This change moves the entry lookup to happen just before the relevant
fuse_add_direntry_plus() calls

12 months agoreset got_init after handling FUSE_DESTROY message (#910)
legezywzh [Thu, 21 Mar 2024 09:02:05 +0000 (17:02 +0800)]
reset got_init after handling FUSE_DESTROY message (#910)

User may still need to mount same fuse filesystem after umounting
it(In this case, the userspace filesystem server needs to keep live),
and after handling FUSE_DESTROY message, new FUSE_INIT message may come,
so need to reset got_init to be zero.

Signed-off-by: Xiaoguang Wang <lege.wang@jaguarmicro.com>
12 months agoci-build.sh: Fix checking for function arguments (#909)
Bernd Schubert [Wed, 20 Mar 2024 15:43:54 +0000 (16:43 +0100)]
ci-build.sh: Fix checking for function arguments (#909)

Checking for an emtpy string actually doesn't work for $@,
so just check for number of arguments.

Co-authored-by: Bernd Schubert <bschubert@ddn.com>
12 months agoAdd FUSE_FILL_DIR_DEFAULTS enum (#903)
FredyVia [Wed, 20 Mar 2024 15:08:04 +0000 (23:08 +0800)]
Add FUSE_FILL_DIR_DEFAULTS enum (#903)

In order to use the fuse_fill_dir_t function in a C++ program, add the enum item:
FUSE_FILL_DIR_DEFAULTS

Without this change g++ compilation failed with
example/hello.c:94:35: error: invalid conversion from ‘int’ to ‘fuse_fill_dir_flags’ [-fpermissive]
   94 |         filler(buf, ".", NULL, 0, 0);
      |                                   ^
      |                                   |
      |                                   int

12 months agoFix example/fix-notify_inval_inode.c (#908)
Bernd Schubert [Wed, 20 Mar 2024 14:25:41 +0000 (15:25 +0100)]
Fix example/fix-notify_inval_inode.c (#908)

Similar issue as fixed in commit
3c7ba570 "examples/notify_store_retrieve: Add a clean shutdown".
Basically a clean shutdown was missing, but even with clean
shutdown it does not work, as kernel side releases inodes before
sending FUSE_DESTROY - the intervaled thread then gets
-ENOENT.

Co-authored-by: Bernd Schubert <bschubert@ddn.com>
12 months agoBump actions/checkout from 4.1.1 to 4.1.2 (#905)
dependabot[bot] [Wed, 20 Mar 2024 13:53:43 +0000 (14:53 +0100)]
Bump actions/checkout from 4.1.1 to 4.1.2 (#905)

Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.1 to 4.1.2.
- [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/b4ffde65f46336ab88eb53be808477a3936bae11...9bb56186c3b09b4f86b1c65136769dd318469633)

---
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>
12 months agoMerge pull request #904 from bsbernd/s-bit-fusermount
Bernd Schubert [Wed, 20 Mar 2024 12:30:12 +0000 (13:30 +0100)]
Merge pull request #904 from bsbernd/s-bit-fusermount

Add back s-bit for compiled fusermount

12 months agoAdd final "meson setup --reconfigure" to README.md
Bernd Schubert [Wed, 20 Mar 2024 11:59:15 +0000 (12:59 +0100)]
Add final "meson setup --reconfigure" to README.md

This reconfigure is recommended to ensure the build system
(ninja/cmake/...) get the updated meson config. They
typically do, but it depends on file time stamps - is
a potential random error source.

12 months ago/test_ctests / test_notify1: Print cmdline on failure
Bernd Schubert [Wed, 20 Mar 2024 11:02:30 +0000 (12:02 +0100)]
/test_ctests / test_notify1: Print cmdline on failure

Tests sometimes fail with

pytest.fail('file system process terminated prematurely')

And it is not clear what actually happens.

12 months agoAdd glibc backtrace to signal handler
Bernd Schubert [Wed, 20 Mar 2024 10:33:46 +0000 (11:33 +0100)]
Add glibc backtrace to signal handler

It is very hard to see in github tests what is actually failing
with signals - add the gnu-libc backtrace handler.

12 months agoci-build.sh: Add back test without versioned symbols
Bernd Schubert [Tue, 19 Mar 2024 23:56:18 +0000 (00:56 +0100)]
ci-build.sh: Add back test without versioned symbols

Commit b1cdc497 ("ci-build.sh: Run ASAN and UBSAN at the same time")
also accidentally removed the test for versioned symbols.

Also export clang/clang++ to make sure new shells get it.

12 months agoBuild clang/sanitized build first
Bernd Schubert [Tue, 19 Mar 2024 23:32:40 +0000 (00:32 +0100)]
Build clang/sanitized build first

This was stalling - easier to check what happens
when it fails fast. And in general, sanitized
builds are faster than valgrind and detect almost
as much errors as valgrind (same level would be
achieved with MSAN, but that is hard to use),
so failures can be detected faster whan sanitizers
run first.

12 months agoFix use-after-free in example/poll.c
Bernd Schubert [Tue, 19 Mar 2024 23:07:44 +0000 (00:07 +0100)]
Fix use-after-free in example/poll.c

As noticed by valgrind in issue #907 example/poll.c
triggers a use-after-free

==85200== Thread 2:
==85200== Invalid read of size 4
==85200==    at 0x485E54A: send_notify_iov (fuse_lowlevel.c:2267)
==85200==    by 0x485E54A: fuse_lowlevel_notify_poll (fuse_lowlevel.c:2289)
==85200==    by 0x1096F2: fsel_producer (poll.c:245)
==85200==    by 0x4897EA6: start_thread (pthread_create.c:477)
==85200==    by 0x49ADA6E: clone (clone.S:95)
==85200==  Address 0x5291d68 is 392 bytes inside a block of size 920 free'd
==85200==    at 0x48399AB: free (vg_replace_malloc.c:538)
==85200==    by 0x485A12C: fuse_destroy (fuse.c:5103)
==85200==    by 0x486220F: fuse_main_real (helper.c:389)
==85200==    by 0x1091D6: main (poll.c:288)
==85200==  Block was alloc'd at
==85200==    at 0x483AB65: calloc (vg_replace_malloc.c:760)
==85200==    by 0x485BAA0: fuse_session_new (fuse_lowlevel.c:3036)
==85200==    by 0x4859AF2: fuse_new@@FUSE_3.1 (fuse.c:4966)
==85200==    by 0x4862129: fuse_main_real (helper.c:345)
==85200==    by 0x1091D6: main (poll.c:288)

Issue is that the "fsel_producer" thread is still active after
fuse_destroy - it gets destructed too late.

12 months agoAdd back s-bit for compiled fusermount
Bernd Schubert [Thu, 14 Mar 2024 20:27:10 +0000 (21:27 +0100)]
Add back s-bit for compiled fusermount

This is also needed by some tests and was accidentally removed
in commit aab146eea8877ee744a1b5a0da8bbbf31d14bad1

12 months agoFix test failures: Create missing mount dir
Bernd Schubert [Wed, 20 Mar 2024 00:14:07 +0000 (01:14 +0100)]
Fix test failures: Create missing mount dir

Tests were failing because mount dir was missing.
Unclear to me why this became only recently an issue
(github internal - out of the sudden tests were hanging).

12 months agoci-build.sh: Reduce pytest --maxfail from 99 to 1
Bernd Schubert [Wed, 20 Mar 2024 00:01:49 +0000 (01:01 +0100)]
ci-build.sh: Reduce pytest --maxfail from 99 to 1

We want to see errors - reduce allowed errors.
With --maxfail=99 tests out of the sudden started to hang
in github, without a change in libfuse (I had actually tested
to previous release tags). With --maxfail=1 pytest aborts
and we see failing github.

Also increase python log level to NOTSET - NOTSET should print
all messages.

Also use "pytest" has wrapper for "python3 -m"

12 months agoMerge pull request #901 from bsbernd/posix_spawn
Bernd Schubert [Thu, 7 Mar 2024 11:03:41 +0000 (12:03 +0100)]
Merge pull request #901 from bsbernd/posix_spawn

Switch from fork to posix_spawn

12 months agoci-build.sh: Always install and add s-bit for fusermount3
Bernd Schubert [Tue, 5 Mar 2024 23:37:53 +0000 (00:37 +0100)]
ci-build.sh: Always install and add s-bit for fusermount3

As per pull #898, fusermount3 had a severe issue that
should have been detected by ASAN. I guess tests used
the system default and not the sanitized binary.
Order of execution of fusermount3 is to try
1) full install path
if that fails
2) just fusermount3

So tests should be fixed by installing libfuse, setting the s-bit
on fusermount3 and then to run the tests.

12 months agoci-build.sh: Run ASAN and UBSAN at the same time
Bernd Schubert [Tue, 5 Mar 2024 23:23:22 +0000 (00:23 +0100)]
ci-build.sh: Run ASAN and UBSAN at the same time

Also set halt_on_error=1 to make UBSAN to fail if it
would find something.

12 months agoposix_spawn style updates
Bernd Schubert [Tue, 5 Mar 2024 14:47:50 +0000 (15:47 +0100)]
posix_spawn style updates

- This adds a wrapper function for the call sequence
of posix_spawn and posix_spawnp.
- Replaces perror() with fuse_log - the latter
can be redirected through the file system log function
and gives better end user friendly output
- other minor changes, like variable renames
- no functional change

12 months agoUse posix_spawn instead of fork+exec
Matthias Goergens [Tue, 5 Mar 2024 14:10:21 +0000 (15:10 +0100)]
Use posix_spawn instead of fork+exec

Client code might allocate a lot of memory before starting the mount.
Fork is slow for processes that are using a lot of memory.  But
posix_spawn fixes that.

Another issue with fork is if the process is also doing RDMA - this
might lead to data corruption, as least if memory used for RDMA
is not marked with MADV_DONTFORK.  At least with linux kernels
before 5.12.
Also see https://blog.nelhage.com/post/a-cursed-bug/ for more details

Change by Bernd:
This also prepares the new fusermount option "--comm-fd", but keeps
the previous way to pass the parameter as env variable. In a future
release (exact data to be determined) we are going to remove usage
of the env variable and will switch to the new parameter.

12 months agoFix undefined loff_t in test_write_cache.c on alpine
Bernd Schubert [Tue, 5 Mar 2024 22:39:44 +0000 (23:39 +0100)]
Fix undefined loff_t in test_write_cache.c on alpine

This fixes #899. Seems that Alpine (and maybe Fedora) need
_GNU_SOURCE to get loff_t.

12 months agofusermount: Fix head-buffer-overflow in extract_x_options
Bernd Schubert [Tue, 5 Mar 2024 17:09:33 +0000 (18:09 +0100)]
fusermount: Fix head-buffer-overflow in extract_x_options

Commit 74b1df2e introduced a heap-buffer-overflow, as
allocated memory was not initialized and extract_x_options
was also not checking for the remaining buffer size.
Fix is to initialize the buffer and to also not exceed the buffer
size. Actually not exceeding buffer size is rather complex with C
and introduced quite some code changes.

Also fixed is a memory leak of allocated buffers in the commit
mentioned above.

13 months agomeson: Point OSX (darwin) to https://www.fuse-t.org/
Bernd Schubert [Sat, 10 Feb 2024 13:46:52 +0000 (14:46 +0100)]
meson: Point OSX (darwin) to https://fuse-t.org/

www.fuse-t.org is a more recent fuse extension for OSX
based on NFS.

13 months agoexample/notify_store_retrieve: Fix races and handle errors
Bernd Schubert [Wed, 10 Jan 2024 14:11:34 +0000 (15:11 +0100)]
example/notify_store_retrieve: Fix races and handle errors

This test was racy, the lookup counter must only be increased once
kernel side has lookup completed and knows about the inode.
However, this is still racy as

app thread
(python script)  kernel-side       libfuse thread       kernel
----------------------------------------------------------------------
    open file
                 lookup req
                 wait
                                   handle req
                                   reply
                                                      wake app thread
                                                      return
                 new_inode()
                 <continue file open>

So actually on libfuse side even after returning from kernel side
it is not ensured that the kernel has created the inode. I.e.
using lookup_cnt in the test is still racy.
A new variabled 'open_cnt' is added that is only increased in open
Using open_cnt should be safe to use as kernel side (with atomic-open)
first does lookup, from that data creates the inode and only then sends
an open request. I.e. update_fs_loop() must only call
fuse_lowlevel_notify_store() once it is absolutely sure kernel side has
created the inode (open_cnt) and when it is sure the kernel inode still
exists (lookup_cnt).

Not really nice, but we actually need to accept some errors, as
these still come up at umount time. Typically it is hard to hit,
but tests in github actually frequently get it. Actually, it can be
easily reproduced by commenting out the sleep line in
update_fs_loop(). Underlying issue is that kernel side is
sending ->destroy() only when it already internally released all
inodes - too late for this test. The errors I run into are ENOENT
and EBADFD, but I added back in ENODEV for safety.

In order to avoid any other kind races mutex lock is also introduced.

13 months agoFix tests/test_write_cache in write back mode (#892)
Bernd Schubert [Mon, 26 Feb 2024 18:09:00 +0000 (19:09 +0100)]
Fix tests/test_write_cache in write back mode (#892)

This test could fail whenever a something (kernel, userspace) decides
to flush in between of two 2048B writes. These two writes are supposed
to be merged into a single 4906 byte write by the kernel writeback cache,
but _sometimes_ the test fails because 2048 byte writes get through.
Fixes #882

Solution here is a modification how the test works - instead
of requiring an exact aggregation of 2x2048B into 4096B,
it now writes 64x2048B and requires in write-back modes
the number of received writes requests is lower than 64 - we
can expect that at least some writes get aggregated, but we do
know how many.

Co-authored-by: Bernd Schubert <bschubert@ddn.com>
13 months agoMerge pull request #888 from yangyun50/master
Bernd Schubert [Mon, 26 Feb 2024 08:48:04 +0000 (09:48 +0100)]
Merge pull request #888 from yangyun50/master

passthrough examples: enable direct io when open has flag: O_DIRECT

13 months agoEnable direct IO for passthrough examples when open has flag O_DIRECT
yangyun [Fri, 23 Feb 2024 06:16:05 +0000 (14:16 +0800)]
Enable direct IO for passthrough examples when open has flag O_DIRECT

Shared locks (parallel_direct_writes) cannot be enabled for O_DIRECT, as
O_DIRECT may be set past file open time with fcntl(fd, F_SETFD, ...).
Kernel side fuse has precautions for shared lock direct-IO (direct_io in
libfuse), as it needs an exclusive inode lock when direct and page cache
IO happend at the same time.

In order to enjoy the parallel_direct_writes feature (i.e., get a shared
lock, not exclusive lock) for writes to the same file), direct_io is needed.
The feature direct_io is corresponding to FOPEN_DIRECT_IO in fuse kernel.
FOPEN_DIRECT_IO and O_DIRECT are not entirely the same as described above.
So enable direct_io (i.e., FOPEN_DIRECT_IO in fuse kernel) to enjoy parallel
direct_writes.

Some patches related to FOPEN_DIRECT_IO and O_DIRECT are below:

https://lore.kernel.org/all/753d6823-e984-4730-a126-d66b65ea772c@ddn.com

13 months agoPassthrough options starting with "x-" to mtab (#894)
Matthew [Sat, 24 Feb 2024 06:56:49 +0000 (22:56 -0800)]
Passthrough options starting with "x-" to mtab (#894)

This implements #651, tested with bindfs.

"x-*" options are comments meant to be interpreted by userspace.

#651 is about some 3rd party mount options like 'x-gvfs-notrash'.

This also removes the test if /etc/mtab is a symlink.

This test was added in commit 5f28cd15ab43c741f6d116be4d3a9aa5d82ab385
and the corresponding ChangeLog entry in this commit points to mount
issues for read-only mtab.

However, in all recent Linux distributions /etc/mtab is a symlink to
/proc/self/mounts and never writable. In fact, util-linux 2.39
(libmount) entirely removed support for a writable mtab.

At least since util-linux 2.19 (10-Feb-2011) /run/mount/utab is used
as replacement for userspace mount entries..

13 months agopassthrough_example: make parallel_direct_writes more clearly
yangyun [Fri, 23 Feb 2024 03:06:08 +0000 (11:06 +0800)]
passthrough_example: make parallel_direct_writes more clearly

Move the parallel_direct_writes enable action to the init function in high level API,
it is more recommended just like commit 8ee553dac. Besides, add some comments to show
that the feature parallel_direct_writes is depend on the feature direct_io (refer to
link: https://lwn.net/ml/linux-fsdevel/
20230918150313.3845114-1-bschubert@ddn.com for the reason).

13 months agoremove duplicated fuse_chan_put() (#893)
yangyun50 [Tue, 20 Feb 2024 10:52:39 +0000 (18:52 +0800)]
remove duplicated fuse_chan_put() (#893)

14 months agomake FUSE_CAP_EXPIRE_ONLY test depend on available cap and not on version
HereThereBeDragons [Mon, 8 Jan 2024 16:38:36 +0000 (17:38 +0100)]
make FUSE_CAP_EXPIRE_ONLY test depend on available cap and not on version

14 months agoadd support for kernel flag FUSE_HAS_EXPIRE_ONLY
HereThereBeDragons [Wed, 6 Dec 2023 14:37:38 +0000 (15:37 +0100)]
add support for kernel flag FUSE_HAS_EXPIRE_ONLY

14 months agoAdd processing for FUSE_CAP_HANDLE_KILLPRIV and disable it by default
bigbrotherwei [Wed, 17 Jan 2024 15:58:27 +0000 (23:58 +0800)]
Add processing for FUSE_CAP_HANDLE_KILLPRIV and disable it by default

'FUSE_CAP_HANDLE_KILLPRIV' is not enabled by default anymore, as that
would be a sudden security issue introduced by a new ABI and API
compatible libfuse version.

14 months agoDon't set FUSE_CAP_PARALLEL_DIROPS by default
Miklos Szeredi [Wed, 10 Jan 2024 09:15:43 +0000 (10:15 +0100)]
Don't set FUSE_CAP_PARALLEL_DIROPS by default

Allowing parallel dir operations could result in a crash in a filesystem
implementation that is not prepared for this.

To be safe keep this flag off by default (this is not a regression, since
there was no public release where this flag wasn't ignored).

If the filesystem wants better performance, then it should set this flag
explicitly.

Fixes: c9905341ea34 ("Pass FUSE_PARALLEL_DIROPS to kernel (#861)")
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
14 months agoAdd FUSE_CAP_DIRECT_IO_ALLOW_MMAP and use in passthrough_hp
Bernd Schubert [Mon, 4 Dec 2023 14:58:45 +0000 (15:58 +0100)]
Add FUSE_CAP_DIRECT_IO_ALLOW_MMAP and use in passthrough_hp

This is not called FUSE_CAP_DIRECT_IO_RELAX, as the kernel flag
FUSE_DIRECT_IO_RELAX is supposed to be renamed to
FUSE_DIRECT_IO_ALLOW_MMAP. The corresponding kernel patches just
did not land yet.