aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorLines
2024-12-30struct fuse_file_info extensionBernd Schubert-1/+17
Add a flags and reserved fields to struct fuse_file_info and add a static assert on the size. Also add another static assert for 'struct fuse_conn_info' Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
2024-12-30Use single bit for struct fuse_file_info::no_interruptBernd Schubert-1/+4
Now that we know the exact size of the integer we can use a single bit and reserve the other bits. Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
2024-12-30Use (u)int32_t for struct fuse_conn_infoBernd Schubert-16/+16
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
2024-12-30Add padding3 in struct fuse_file_infoBernd Schubert-0/+1
pahole was showing a 4 byte hole - add another padding to fill that hole. Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
2024-12-30Use (u)int32_t for struct fuse_file_infoBernd Schubert-10/+10
Enforce 32 bit integers for #struct fuse_file_info'. Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
2024-12-30Use (u)int32_t for struct fuse_config and extend the structBernd Schubert-24/+34
Enforce 32-bit integers for struct fuse_config and add future ABI fields to that struct. Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
2024-12-30Restore compat ABI in 'struct fuse_config'Bernd Schubert-8/+8
This fixes commit dad15aee26835 "Add no_rofd_flush mount option" and restores the ABI by moving the no_rofd_flush field. Given that there were already several releases with this commit we will still need an so version bump. Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
2024-12-30Restore compat ABI in 'struct fuse_file_info'Bernd Schubert-19/+20
This fixes commit a5eb7f2 "Enable parallel direct writes on the same file" and restores the ABI by moving the parallel_direct_writes bit. Given that there were already several releases with this commit we will still need an so version bump. Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
2024-12-28build(deps): bump github/codeql-action from 3.27.9 to 3.28.0dependabot[bot]-2/+2
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>
2024-12-18Rename _int to _internalBernd Schubert-16/+20
_int can be confused with 'integer'
2024-12-18Allow to have page aligned writesBernd Schubert-41/+103
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
2024-12-17tests: Add debug messages to some tests and umountBernd Schubert-16/+97
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.
2024-12-16build(deps): bump github/codeql-action from 3.27.5 to 3.27.9dependabot[bot]-2/+2
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>
2024-12-13examples: Add memfs_ll.ccBernd Schubert-1/+1160
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>
2024-11-27support FUSE_TMPFILE in the low level APIHorst Birthelmer-19/+311
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
2024-11-26build(deps): bump github/codeql-action from 3.27.4 to 3.27.5dependabot[bot]-2/+2
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>
2024-11-21Fix alignment of allocation in fuse_reply_createVladimir Serbinenko-1/+2
When allocating as an array of char only alignment of 1 is guaranteed but the structure needs an alignment of 8. Specify alignment explicitly
2024-11-21Reallocate fuse_session buffer transparently for extended max writesJoanne Koong-31/+41
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
2024-11-20build(deps): bump github/codeql-action from 3.27.1 to 3.27.4dependabot[bot]-2/+2
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>
2024-11-18Use fuse_session_{receive/process}_buf() instead of _int versionJoanne Koong-4/+4
No functional changes.
2024-11-13Add FUSE_CAP_NO_EXPORT and use it in passthrough_hpBernd Schubert-1/+25
This should stop some more xfstest test failures.
2024-11-13Add fuse_set_feature_flag() / fuse_unset_feature_flagBernd Schubert-20/+41
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.
2024-11-13build(deps): bump github/codeql-action from 3.27.0 to 3.27.1dependabot[bot]-2/+2
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>
2024-10-30Correct arg documentation for FUSE_READLINKBernd Schubert-1/+1
It does not have an in-argument.
2024-10-29build(deps): bump github/codeql-action from 3.26.13 to 3.27.0dependabot[bot]-2/+2
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>
2024-10-29build(deps): bump actions/checkout from 4.2.1 to 4.2.2dependabot[bot]-5/+5
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>
2024-10-20codeql workflow: Switch from pip to aptBernd Schubert-2/+2
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.
2024-10-20Update libfuse-operations.txt for FUSE_SYMLINKBernd Schubert-2/+2
2024-10-14Create codeql.ymlBernd Schubert-0/+80
2024-10-14fuse_buf_size fix for SIZE_MAXleipeng-4/+4
2024-10-11Add libfuse util strtol wrapperJoanne Koong-21/+66
Add a wrapper around strtol for more rigorous error checking and convert uses of atoi and strtol to use this instead.
2024-10-11build(deps): bump actions/checkout from 4.2.0 to 4.2.1dependabot[bot]-4/+4
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>
2024-10-11ignore mtab on androidDaniel Rosenberg-1/+1
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>
2024-10-04build(deps): bump actions/checkout from 4.1.7 to 4.2.0dependabot[bot]-4/+4
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>
2024-09-28fuse_lowlevel FUSE_INIT: Simplify the max_write/bufsize logicBernd Schubert-5/+9
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).
2024-09-28fuse_lowlevel FUSE_INIT: group bufsize and max_write adjustmentsBernd Schubert-12/+12
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.
2024-09-28Change FUSE_MAX_MAX_PAGES to FUSE_DEFAULT_MAX_PAGES_LIMITJoanne Koong-4/+10
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
2024-09-28Initialize session buffer size to value set by sysctlJoanne Koong-1/+24
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
2024-09-25ABI check: Use base commit / branch of a PR for ABI comparisonBernd Schubert-5/+2
The base commit is needed for comparison when a PR has multiple commits.
2024-09-24Libfuse check ABI differences with 'abidiff'Bernd Schubert-0/+67
2024-09-23add version check for the fuse_loop_cfg* operationsyangyun-2/+13
fuse_loop_cfg* operations are introduced in fuse version 312 and can not be used in an early version. Also fix some typo.
2024-09-19passthrough_hp: Use fuse_loop_cfg_set_max_threads()Bernd Schubert-1/+1
fuse_loop_cfg_set_idle_threads() was by accident and setting it might cause a performance issue.
2024-09-16fusermount: Close file descriptors with close_range() if possibleBernd Schubert-1/+26
close_range() is much more efficient. Also remove the lower limit of 3 and set it to 0, as 0 to 1 might have been closed by the application and might be valid.
2024-09-16fusermount: close inherited fdsMJ Harvey-1/+19
When using the auto_unmount option, the fusermount3 watchdog process retains any inherited file descriptors. This PR ensures they are closed. Reason is that FDs that are kept open for a long time might cause issues for applications using libfuse, for example if these expect a pipe close, but the pipe is kept open through the inherited file descriptor. See for example: https://github.com/cvmfs/cvmfs/issues/3645 Signed-off-by: MJ Harvey <mharvey@jumptrading.com> Signed-off-by: Bernd Schubert <bschubert@ddn.com>
2024-09-13example/passthrough_hp: Set keep_cache and noflush in sfs_createBernd Schubert-2/+3
These flags should be also set for O_CREAT
2024-09-13example/passthrough_hp: No auto FOPEN_DIRECT_IO in passthrough modeBernd Schubert-22/+27
sfs_open and sfs_create set fi->direct_io (FOPEN_DIRECT_IO) when O_DIRECT is given, in order to benefit from a shared inode lock in kernel, i.e. to get parallel DIO writes. However, kernel side disabled passthrough when FOPEN_DIRECT_IO is set. Reads/writes had been totally failing in this case for O_DIRECT as sfs_write_buf() and sfs_read() have a sanity check. That sanity check could be modified, but for performance passthrough is better than parallel DIO, hence, we only want automatic FOPEN_DIRECT_IO for O_DIRECT when passthrough is not enabled. Fixes: https://github.com/libfuse/libfuse/issues/1027 This also fixes automatically switching to FOPEN_DIRECT_IO for O_DIRECT in sfs_create().
2024-09-12getattr: Make use of FUSE_GETATTR_FH in lowlevel examplesBernd Schubert-7/+8
High level examples were already using it, but not lowlevel. Also update the documentation.
2024-09-05Bump codespell-project/actions-codespell from 2.0 to 2.1dependabot[bot]-1/+1
Bumps [codespell-project/actions-codespell](https://github.com/codespell-project/actions-codespell) from 2.0 to 2.1. - [Release notes](https://github.com/codespell-project/actions-codespell/releases) - [Commits](https://github.com/codespell-project/actions-codespell/compare/94259cd8be02ad2903ba34a22d9c13de21a74461...406322ec52dd7b488e48c1c4b82e2a8b3a1bf630) --- updated-dependencies: - dependency-name: codespell-project/actions-codespell dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
2024-08-26remove unused headers in example/poll_clientyangyun-1/+0
fuse_config.h is used in libfuse internally. This may confuse developers that fuse_config.h is used in the examples.
2024-08-21Rearrange util/fusermount.c umount_fuse_locked() so thatNorman Wilson-2/+4
umount2 is called with privs dropped, not raised. This works around a clash with NFS permissions: if FUSE mounted on NFS client directory with root_squash in effect, and some directory in the path leading to the mount point denies permissions to others, umount2 will fail because userid 0 cannot search it. Since drop_privs merely sets the file- system user- and group-ID without changing the CAP_SYS_ADMIN capability needed to unmount a file system (which fusermount has because it is set-user-ID root), umount2 works fine.