Skip to content

Add libfuse 3 support with libfuse 2 fallback - #603

Open
matejk wants to merge 3 commits into
LinearTapeFileSystem:release/v2.4.9.0from
matejk:fuse3-port
Open

Add libfuse 3 support with libfuse 2 fallback#603
matejk wants to merge 3 commits into
LinearTapeFileSystem:release/v2.4.9.0from
matejk:fuse3-port

Conversation

@matejk

@matejk matejk commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Port of LTFS to libfuse 3 with a compile-time libfuse 2 fallback, plus the FUSE 3 performance features. Based on the v2.4.8.4 release on main, 3 commits (the port, the performance features, macOS support). The test suite, the bug fixes found during this work, and the CMake build are separate independent PRs.

FUSE 3 support

  • Builds against fuse3 (>= 3.4) by default on Linux, with automatic fallback to fuse2 when fuse3 is absent; --with-fuse2 forces the legacy API (still the default on macOS and the BSDs).
  • Handlers use FUSE 3 signatures: getattr/truncate absorb the handle variants, chmod/utimens use the file handle when the path is NULL (nullpath_ok), rename handles RENAME_NOREPLACE/RENAME_EXCHANGE, use_ino/hard_remove/nullpath_ok move into fuse_config, and FUSE_CAP_ASYNC_READ is cleared to keep tape reads ordered (-o sync_read no longer exists).
  • fuse_file_info.parallel_direct_writes is feature-detected (the field appeared in libfuse 3.15; version checks broke on ubuntu-24.04's 3.14).
  • macOS: with macFUSE 5 (which ships a libfuse 3), the FUSE 3 build works via FUSE_DARWIN_ENABLE_EXTENSIONS=0; macOS keeps fuse2 as its default.

Performance

  • 1 MiB FUSE requests (-o max_write=N): measured 1 MiB writes and O_DIRECT reads reaching the daemon, vs 128 KiB on fuse2.
  • -o direct_io: all I/O bypasses the kernel page cache; ~70 % higher sequential write throughput on the file backend and a flat page cache during large streaming jobs.
  • readdirplus: ls -l over 100 files needs 2 getattr requests instead of 102 (effective with libfuse >= 3.17).

Relationship to the other PRs

Verification

With #607 and #611 merged alongside: all 14 integration tests pass with fuse3 and fuse2, via make check and ctest, against libfuse 3.14 and 3.17; zero compiler warnings at -Wall -Wextra; macOS compile-verified for both APIs against the macFUSE 5.2 SDK.

Issues

@matejk
matejk force-pushed the fuse3-port branch 2 times, most recently from 3068ef8 to 051a223 Compare June 12, 2026 09:35
@matejk matejk changed the title Port to FUSE 3, performance features, test suite, CMake build, and bug fixes Add libfuse 3 support with libfuse 2 fallback Jun 12, 2026
@matejk
matejk marked this pull request as draft June 12, 2026 09:40
@matejk
matejk force-pushed the fuse3-port branch 3 times, most recently from 9371bee to 0f4763f Compare June 12, 2026 10:19
@matejk
matejk marked this pull request as ready for review June 12, 2026 10:22

@vandelvan vandelvan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @matejk ! Thank you for contributing, there are a couple of things in this PR that seem to be part of your other PRs, please remove/move the extra changes as they are not related to fuse3

Comment thread tests/t/10-request-size.sh Outdated
Comment thread src/iosched/unified.c
@matejk

matejk commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

Done. The data-loss change is removed (it stays in #607) and the test scripts are removed (they stay in #611); this PR is now fuse3-only, 3 commits. One note: #607 should merge before or together with this PR, because FUSE 3's 1 MiB requests trigger that bug.

@matejk
matejk requested a review from vandelvan July 7, 2026 09:44
@vandelvan
vandelvan changed the base branch from main to release/v2.4.9.0 July 10, 2026 20:18

@vandelvan vandelvan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution! LGTM

matejk added 3 commits August 17, 2026 22:05
configure prefers fuse3 on Linux and falls back to fuse2; --with-fuse2 forces
the libfuse 2 API and stays the default on macOS and the BSDs.
1 MiB requests, -o direct_io and readdirplus. parallel_direct_writes is
detected at configure time; libfuse 3.14 lacks it.
FUSE_DARWIN_ENABLE_EXTENSIONS=0 selects the upstream operation signatures
that macFUSE's libfuse 3 also exports.
@matejk
matejk force-pushed the fuse3-port branch 2 times, most recently from 679907e to f4400f0 Compare August 17, 2026 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants