macOS: reply-error resilience, mount option joining, reply-drop log demotion#1
Open
dlicudi wants to merge 19 commits into
Open
macOS: reply-error resilience, mount option joining, reply-drop log demotion#1dlicudi wants to merge 19 commits into
dlicudi wants to merge 19 commits into
Conversation
Move the sending of responses from the mount task into the the responding tasks. This allows us to borrow references to the constructed structs so that we do not need to allocate vectors to send around. Add a new notify instance, to stop the mount task in case of a write error
Use zerocopy to get rid of many allocations.
* ci: move to github ci the cirrus compute credits is too few * ci: update freebsd version
Fix the docs build with Rust nightly 1.92.0 and later
ci: remove ca_root_nss workaround for FreeBSD
handle_getxattr was sending `error: libc::ERANGE` (positive 34) in the
fuse_out_header when returning ReplyXAttr::Size. The FUSE protocol
requires negative errno values for errors and 0 for success. The Linux
kernel rejects positive error codes:
if (oh->error <= -512 || oh->error > 0) {
req->out.h.error = -EIO;
This caused all getxattr size queries (size=0) to fail.
The fix matches handle_listxattr, which already correctly uses error: 0
for the same Size reply path, and matches libfuse's fuse_reply_xattr
which uses send_reply_ok (error=0).
Fixes Sherlock-Holo#130
fix: use error=0 for getxattr Size reply instead of ERANGE
…to ReplyInit Allow filesystems to override the kernel's default FUSE background request limits during init. The kernel defaults (max_background=12, congestion_threshold=9) are too low for high-concurrency workloads where many parallel reads are expected. Adds two optional fields to both `raw::ReplyInit` and `path::ReplyInit`: - `max_background: Option<u16>` - max pending background requests - `congestion_threshold: Option<u16>` - throttling threshold When `None`, the kernel defaults are preserved (backward compatible). Both `ReplyInit` structs are marked `#[non_exhaustive]` with a `new()` constructor so future fields can be added without breaking downstream code.
…ound feat(init): add configurable max_background and congestion_threshold to ReplyInit
macFUSE can transiently reject a reply write to /dev/macfuse with EINVAL (or EAGAIN/EINTR) under heavy concurrent load — e.g. while Spotlight crawls the mount. The session loop treated ANY non-NotFound reply-send failure as fatal (send_failed.notify -> session returns Err), so a single transient failure tore down the whole mount and left it wedged (every later op ENXIO). Route send1/send2/send3's error handling through a shared handle_send_error that treats transient, per-request errors (ENOENT, EINVAL, EAGAIN, EINTR) as recoverable — drop that one reply and keep serving — while connection-gone errors (ENODEV/EBADF on unmount) stay fatal so a clean unmount still stops the session. Policy extracted to a pure is_recoverable_reply_error fn with unit tests.
macOS build() emitted repeated space-separated -o flags as a single mount- helper argument, so every option after the first (allow_root, allow_other, or caller custom_options like nobrowse) was silently dropped. Join with commas under one -o, matching the Linux builder.
A recoverable reply-send failure (interrupted/cancelled request) is the expected, harmless case the resilience patch exists to absorb. macOS file browsers crawl the mount and routinely interrupt their own requests, so these occur tens of times per second under normal use — logging each at WARN floods the log. Demote to debug; the session-continues handling is unchanged.
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Carries the three macOS patches that XEarthLayer's macOS port (
feat/macos-port-clean) depends on, based cleanly on current upstream master. Offered here per the review discussion, so XEarthLayer does not have to pin a personal fork.Commits
fix(macos): don't kill the session on a transient reply error— macFUSE can drop replies transiently; without this the whole FUSE session dies mid-flight. Also pending upstream as fix(macos): don't kill the session on a transient reply error Sherlock-Holo/fuse3#137.fix(macos): comma-join mount options so all -o flags apply— macFUSE only honors the first-oflag unless options are comma-joined; without this, mount options past the first were silently ignored.fix(macos): log recoverable reply drops at debug, not warn— recoverable per-syscall reply drops flooded logs at warn level.Notes
feat/macos-port-cleancurrently pinsdlicudi/fuse3rev74abf55(the head of this branch); once this is merged, the pin will be repointed to this repo.🤖 Generated with Claude Code