Nikita Shubin [Sat, 22 Feb 2025 05:12:42 +0000 (08:12 +0300)]
guse: add example
Signed-off-by: Nikita Shubin <n.shubin@yadro.com>
Nikita Shubin [Sat, 22 Feb 2025 05:12:11 +0000 (08:12 +0300)]
WIP: add guse lowlevel
Signed-off-by: Nikita Shubin <n.shubin@yadro.com>
dependabot[bot] [Mon, 23 Dec 2024 22:27:38 +0000 (22:27 +0000)]
build(deps): bump github/codeql-action from 3.27.9 to 3.28.0
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.27.9 to 3.28.0.
- [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/
df409f7d9260372bd5f19e5b04e83cb3c43714ae...
48ab28a6f5dbc2a99bf1e0131198dd8f1df78169)
---
updated-dependencies:
- dependency-name: github/codeql-action
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
Bernd Schubert [Tue, 17 Dec 2024 19:21:09 +0000 (20:21 +0100)]
Rename _int to _internal
_int can be confused with 'integer'
Bernd Schubert [Mon, 16 Dec 2024 22:37:29 +0000 (23:37 +0100)]
Allow to have page aligned writes
Read/writes IOs should be page aligned as fuse server
might need to copy data to another buffer otherwise in
order to fulfill network or device storage requirements.
Simple reproducer is example/passthrough*
and opening a file with O_DIRECT - without this change
writing to that file failed with -EINVAL if the underlying
file system was using ext4 (for passthrough_hp the
'passthrough' feature has to be disabled).
The mis-alignment from fuse kernel is not ideal, but we can handle
it by allocation one page more than needed and then using a buffer
that is set up to compensate for kernel misalignment.
This also only set se->buf_reallocable to true when called
by a libfuse internal caller - we do not know what
external callers are doing with the buffer - update to
commit
0e0f43b79b9b
Bernd Schubert [Thu, 12 Dec 2024 22:21:05 +0000 (23:21 +0100)]
tests: Add debug messages to some tests and umount
On my nfs mount the tests were hanging and it was impossible
to diagnoze what is actually the issue.
Also get rid of 'looseversion' python package dependency,
as that package is not in ubuntu - add a handcode kernel
version parser.
dependabot[bot] [Mon, 16 Dec 2024 22:24:44 +0000 (22:24 +0000)]
build(deps): bump github/codeql-action from 3.27.5 to 3.27.9
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.27.5 to 3.27.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/
f09c1c0a94de965c15400f5634aa42fac8fb8f88...
df409f7d9260372bd5f19e5b04e83cb3c43714ae)
---
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>
Bernd Schubert [Thu, 12 Dec 2024 15:08:50 +0000 (16:08 +0100)]
examples: Add memfs_ll.cc
This is an initial implementation and quickly hacked together
within a few hours - issues expected.
This also increase to C++17 as memfs_ll makes use of more
recent features.
Background to create this was actually to be able to test large
file names (3 * 1024B), which couldn't be achieved with passthrough
file system as non of the underlying file systems seems to support
that.
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
Horst Birthelmer [Wed, 20 Nov 2024 15:14:43 +0000 (16:14 +0100)]
support FUSE_TMPFILE in the low level API
Note that name hashes and using paths as parameters
makes it very hard to support
anonymous files in the high level API.
Known Issues:
- tests have to bail out when O_TMPFILE is not supported.
This will always be the case with high level passthrough implementations.
- test_create_and_link_tmpfile has to be skipped
due to unidentified problems with github runner
dependabot[bot] [Mon, 25 Nov 2024 23:04:02 +0000 (23:04 +0000)]
build(deps): bump github/codeql-action from 3.27.4 to 3.27.5
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.27.4 to 3.27.5.
- [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/
ea9e4e37992a54ee68a9622e985e60c8e8f12d9f...
f09c1c0a94de965c15400f5634aa42fac8fb8f88)
---
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>
Vladimir Serbinenko [Wed, 20 Nov 2024 18:16:16 +0000 (21:16 +0300)]
Fix alignment of allocation in fuse_reply_create
When allocating as an array of char only alignment of 1 is guaranteed but
the structure needs an alignment of 8. Specify alignment explicitly
Joanne Koong [Fri, 15 Nov 2024 04:55:48 +0000 (20:55 -0800)]
Reallocate fuse_session buffer transparently for extended max writes
A previous PR supported extended max writes (eg write requests larger than 1 MB)
by initializing the fuse session buffer size to use the max_pages_limit set in
/proc/sys/fs/fuse. However, this is a huge problem for machines where multiple
fuse servers may be running but only one server needs large writes. In this case,
a lot of memory will be wasted and will lead to OOM issues.
This PR does a reallocation of the session buffer transparently if the server set
"se->conn.max_write" to a value larger than 1 MiB. This is only for buffers that
are "owned" by libfuse - if the server wishes to provide its own allocated buffer
for receiving/processing requests, then it should ensure that buffer is allocated
to the proper size from the start.
Local testing showed:
echo 65535 | sudo tee /proc/sys/fs/fuse/max_pages_limit
dd if=/dev/urandom of=hello_file bs=6M count=2
write requests:
write request size is
5242880
write request size is
1048576
write request size is
5242880
write request size is
1048576
dependabot[bot] [Mon, 18 Nov 2024 23:00:01 +0000 (23:00 +0000)]
build(deps): bump github/codeql-action from 3.27.1 to 3.27.4
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.27.1 to 3.27.4.
- [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/
4f3212b61783c3c68e8309a0f18a699764811cda...
ea9e4e37992a54ee68a9622e985e60c8e8f12d9f)
---
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>
Joanne Koong [Fri, 15 Nov 2024 03:45:43 +0000 (19:45 -0800)]
Use fuse_session_{receive/process}_buf() instead of _int version
No functional changes.
Bernd Schubert [Thu, 19 Sep 2024 13:09:04 +0000 (15:09 +0200)]
Add FUSE_CAP_NO_EXPORT and use it in passthrough_hp
This should stop some more xfstest test failures.
Bernd Schubert [Thu, 19 Sep 2024 13:03:55 +0000 (15:03 +0200)]
Add fuse_set_feature_flag() / fuse_unset_feature_flag
Simplify setting feature flags a bit by adding a helper
function.
Also move the check for valid flags into a funtion we can re-use
in a later patch.
dependabot[bot] [Mon, 11 Nov 2024 22:15:05 +0000 (22:15 +0000)]
build(deps): bump github/codeql-action from 3.27.0 to 3.27.1
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.27.0 to 3.27.1.
- [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/
662472033e021d55d94146f66f6058822b0b39fd...
4f3212b61783c3c68e8309a0f18a699764811cda)
---
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>
Bernd Schubert [Wed, 30 Oct 2024 14:25:22 +0000 (15:25 +0100)]
Correct arg documentation for FUSE_READLINK
It does not have an in-argument.
dependabot[bot] [Tue, 29 Oct 2024 09:37:03 +0000 (09:37 +0000)]
build(deps): bump github/codeql-action from 3.26.13 to 3.27.0
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.26.13 to 3.27.0.
- [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/
f779452ac5af1c261dce0346a8f964149f49322b...
662472033e021d55d94146f66f6058822b0b39fd)
---
updated-dependencies:
- dependency-name: github/codeql-action
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
dependabot[bot] [Mon, 28 Oct 2024 22:22:33 +0000 (22:22 +0000)]
build(deps): bump actions/checkout from 4.2.1 to 4.2.2
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.2.1 to 4.2.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/
eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871...
11bd71901bbe5b1630ceea73d27597364c9af683)
---
updated-dependencies:
- dependency-name: actions/checkout
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
Bernd Schubert [Sun, 20 Oct 2024 07:36:14 +0000 (09:36 +0200)]
codeql workflow: Switch from pip to apt
On some runs:
Run pip install --break-system-packages -r requirements.txt
....
no such option: --break-system-packages
Error: Process completed with exit code 2.
On other runs it refuses to install and asks for that option
as it refuses to override system packages.
Also require ubuntu-latest only, as MacOS is not supported at all
by libfuse.
Bernd Schubert [Thu, 17 Oct 2024 16:59:44 +0000 (18:59 +0200)]
Update libfuse-operations.txt for FUSE_SYMLINK
Bernd Schubert [Mon, 14 Oct 2024 18:49:24 +0000 (20:49 +0200)]
Create codeql.yml
leipeng [Fri, 11 Oct 2024 07:54:14 +0000 (15:54 +0800)]
fuse_buf_size fix for SIZE_MAX
Joanne Koong [Mon, 7 Oct 2024 20:37:20 +0000 (13:37 -0700)]
Add libfuse util strtol wrapper
Add a wrapper around strtol for more rigorous error checking
and convert uses of atoi and strtol to use this instead.
dependabot[bot] [Mon, 7 Oct 2024 22:59:31 +0000 (22:59 +0000)]
build(deps): bump actions/checkout from 4.2.0 to 4.2.1
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.2.0 to 4.2.1.
- [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/
d632683dd7b4114ad314bca15554477dd762a938...
eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871)
---
updated-dependencies:
- dependency-name: actions/checkout
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
Daniel Rosenberg [Thu, 3 Oct 2024 21:52:22 +0000 (14:52 -0700)]
ignore mtab on android
Updating the mtab on Android fails due to differences in toybox's mount
command. Setting IGNORE_MTAB avoids that issue.
Signed-off-by: Daniel Rosenberg <drosen@google.com>
dependabot[bot] [Mon, 30 Sep 2024 22:52:27 +0000 (22:52 +0000)]
build(deps): bump actions/checkout from 4.1.7 to 4.2.0
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.7 to 4.2.0.
- [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/
692973e3d937129bcbf40652eb9f2f61becf3332...
d632683dd7b4114ad314bca15554477dd762a938)
---
updated-dependencies:
- dependency-name: actions/checkout
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
Bernd Schubert [Fri, 27 Sep 2024 18:37:51 +0000 (20:37 +0200)]
fuse_lowlevel FUSE_INIT: Simplify the max_write/bufsize logic
max_write can be limited by se->op.init() and by the buffer size,
we use the minimum of these two.
Required se->bufsize is then set according to the determined
max_write. The current thread will have the old buffer size,
though, as it already had to the allocation to handle the
FUSE_INIT call (unless splice is used and ths variable
and related buffer is not used at all).
The given bufsize is just a hint for minimum size, allocation
could be actually larger (for example to get huge pages).
Bernd Schubert [Thu, 26 Sep 2024 22:57:21 +0000 (00:57 +0200)]
fuse_lowlevel FUSE_INIT: group bufsize and max_write adjustments
The further these lines are separated from each other the harder
it is to read the code.
There shouldn't be any code change behavior here.
Joanne Koong [Fri, 27 Sep 2024 00:33:39 +0000 (17:33 -0700)]
Change FUSE_MAX_MAX_PAGES to FUSE_DEFAULT_MAX_PAGES_LIMIT
A recent upstream patch [1] changed FUSE_MAX_MAX_PAGES to
FUSE_DEFAULT_MAX_PAGES_LIMIT.
Update libfuse to use FUSE_DEFAULT_MAX_PAGES_LIMIT as well
instead of FUSE_MAX_MAX_PAGES.
[1] https://lore.kernel.org/linux-fsdevel/
20240923171311.
1561917-1-joannelkoong@gmail.com/T/#t
Joanne Koong [Thu, 26 Sep 2024 00:49:56 +0000 (17:49 -0700)]
Initialize session buffer size to value set by sysctl
Currently in libfuse, the buffer size for a fuse session is
capped at 1 MiB on a 4k page system. A recent patch
upstream [1] was merged that allows the max number of pages
per fuse request to be dynamically configurable through the
/proc/sys interface (/proc/sys/fs/fuse/max_pages_limit).
This commit adds support for this on the libfuse side to set
the fuse session buffer to take into account the max pages
limit set in /proc/sys/fs/fuse/max_pages_limit. If this
sysctl does not exist (eg older kernels), it will default to
old behavior (using FUSE_MAX_MAX_PAGES (256) as the max pages
limit). This allows for things like bigger write buffers per
request.
[1] https://lore.kernel.org/linux-fsdevel/
20240923171311.
1561917-1-joannelkoong@gmail.com/T/#t
Bernd Schubert [Wed, 25 Sep 2024 10:11:44 +0000 (12:11 +0200)]
ABI check: Use base commit / branch of a PR for ABI comparison
The base commit is needed for comparison when a PR has multiple
commits.
Bernd Schubert [Tue, 24 Sep 2024 15:54:40 +0000 (17:54 +0200)]
Libfuse check ABI differences with 'abidiff'
yangyun [Tue, 20 Aug 2024 08:41:20 +0000 (16:41 +0800)]
add version check for the fuse_loop_cfg* operations
fuse_loop_cfg* operations are introduced in fuse version 312 and
can not be used in an early version.
Also fix some typo.
Bernd Schubert [Sat, 14 Sep 2024 18:56:36 +0000 (20:56 +0200)]
passthrough_hp: Use fuse_loop_cfg_set_max_threads()
fuse_loop_cfg_set_idle_threads() was by accident and
setting it might cause a performance issue.
Bernd Schubert [Fri, 13 Sep 2024 18:43:33 +0000 (20:43 +0200)]
fusermount: Close file descriptors with close_range() if possible
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.
MJ Harvey [Wed, 21 Aug 2024 12:05:20 +0000 (07:05 -0500)]
fusermount: close inherited fds
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>
Bernd Schubert [Thu, 12 Sep 2024 14:30:43 +0000 (16:30 +0200)]
example/passthrough_hp: Set keep_cache and noflush in sfs_create
These flags should be also set for O_CREAT
Bernd Schubert [Thu, 12 Sep 2024 14:06:09 +0000 (16:06 +0200)]
example/passthrough_hp: No auto FOPEN_DIRECT_IO in passthrough mode
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().
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.
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>
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.
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.
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.
Joanne Koong [Tue, 6 Aug 2024 22:14:04 +0000 (15:14 -0700)]
doc/libfuse-operations: Fix FUSE_STATX in_args[1] description
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.
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>
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>
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>
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>
Bernd Schubert [Mon, 29 Jul 2024 19:57:56 +0000 (21:57 +0200)]
Add a script to parse backtraces
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.
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>
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
Joanne Koong [Tue, 16 Jul 2024 19:57:59 +0000 (12:57 -0700)]
fuse_log: initialize sys_log_level variable to avoid compiler warning
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
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.
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.
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>
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.
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.
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.
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.
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.
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
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.
CismonX [Thu, 20 Jun 2024 20:36:47 +0000 (04:36 +0800)]
Fix wrong use of the EBADFD errno
should use EBADF instead
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
trapexit [Fri, 21 Jun 2024 19:08:50 +0000 (14:08 -0500)]
Update AUTHORS
Co-authored-by: Ashley Pittman <ashley@pittman.co.uk>
Antonio SJ Musumeci [Fri, 21 Jun 2024 18:20:24 +0000 (13:20 -0500)]
Update AUTHORS
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>
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>
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.
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>
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
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
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.
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.
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.
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>
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.
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.
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>
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>
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>
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>
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>
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.
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>
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>
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.
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>
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.
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>
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.
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>
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>
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>
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.