Skip to content

fix(chunked_fuse): lazy fallback to st_ctime for macOS crtime field#3196

Open
jackd wants to merge 1 commit intometa-pytorch:mainfrom
jackd:fix/crtime-lazy-fallback
Open

fix(chunked_fuse): lazy fallback to st_ctime for macOS crtime field#3196
jackd wants to merge 1 commit intometa-pytorch:mainfrom
jackd:fix/crtime-lazy-fallback

Conversation

@jackd
Copy link
Copy Markdown

@jackd jackd commented Mar 25, 2026

Full disclosure: I'm not a rust guy, nor am I a mac person. An agent proposed this to resolve a build failure I was having, other agents agreed, and having made the change the build now succeeds. Below is a summary generated by one such agent.

Summary

On macOS, fuse3's FileAttr struct requires two extra fields not present on Linux: crtime (file creation time) and flags. This PR adds both.

For crtime, the implementation prefers st_birthtime from the Python stat dict when available (e.g. on real macOS filesystems), and falls back to st_ctime when the key is absent (e.g. when the remote filesystem or Python stat implementation doesn't populate it). This avoids panics/errors when mounting a FUSE filesystem on macOS against a remote that doesn't expose birthtime.

flags is set to 0 as there are no relevant BSD file flags to propagate.

Both fields are gated with #[cfg(target_os = "macos")] so Linux builds are unaffected.

Changes

chunked_fuse.rs: In extract_attr, conditionally populate crtime (with lazy st_ctime fallback) and flags on macOS.

Testing

Compile-tested on macOS. The fallback path handles filesystems that don't expose st_birthtime without returning an error.

Note: USE_TENSOR_ENGINE=0 uv sync resulted in an updated uv.lock package entry for name = "py-spy". I assume this is unrelated to these changes and is down to an outdated uv.lock file in the repo.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Mar 25, 2026
@jackd
Copy link
Copy Markdown
Author

jackd commented Mar 25, 2026

@cpuhrsch possibly most relevant?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant