Skip to content

fix: preserve macOS bulk metadata fallback and stat semantics - #1

Closed
huntharo wants to merge 1 commit into
mainfrom
perf/macos-native-metadata
Closed

huntharo wants to merge 1 commit into
mainfrom
perf/macos-native-metadata

Conversation

@huntharo

@huntharo huntharo commented Sep 27, 2026 •

Copy link
Copy Markdown
Owner

Main already uses getattrlistbulk for macOS enumeration. This change adds fallback and metadata compatibility handling to that path.

When the first bulk call returns ENOTSUP, ENOSYS or EACCES, the reader falls back to std::fs::read_dir, preserving name enumeration and per-entry metadata errors. It never restarts after returning entries, which would duplicate part of the tree.

Additional behavior:

  • Pre-epoch modification times map to zero, matching the standard scanner’s timestamp handling.
  • Firmlink records and missing attributes use visible-path, no-follow metadata; directory checks run before descent.
  • Packed records validate returned attribute masks, field bounds and filename boundaries, retaining raw OS error codes.

Tests cover malformed and truncated records, omitted attributes, fallback before/after partial enumeration, permissions, timestamps, firmlink fixtures, disappearing directories, multiple buffers and accounting parity.

Validation at b36bad6: 157 core tests passed (2 ignored), 71 app tests passed, and cargo +1.97.1 xtask lint passed.

Tradeoff and limits: the current patch replaces the macOS reader, adds a direct macOS libc dependency and does not retain main’s per-thread buffer reuse. No performance improvement over current main has been established. Unsupported-enumeration fallback and firmlink cases include injected fixtures; a real unsupported filesystem and live evicted cloud-provider behavior remain untested.

@huntharo
huntharo force-pushed the perf/macos-native-metadata branch from 5c46436 to b36bad6 Compare October 14, 2026 16:32
@huntharo huntharo changed the title perf: batch macOS metadata during directory enumeration fix: preserve macOS bulk metadata fallback and stat semantics Oct 14, 2026
@huntharo huntharo closed this Oct 14, 2026
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.

1 participant