Skip to content

Propagate root-device lookup failures - #357

Merged
Byron merged 2 commits into
mainfrom
crossdev-fix
Aug 3, 2026
Merged

Propagate root-device lookup failures#357
Byron merged 2 commits into
mainfrom
crossdev-fix

Conversation

@Byron

@Byron Byron commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Tasks

This section is for Byron only. Models continuing this PR must not add, remove, check, uncheck, rename, or reorder checkboxes here.

  • refackiew

Everything below this line was generated by Codex GPT-5.

Created by Codex on behalf of Byron. Byron will review before this is ready to merge.

Reported issue

Propagate root-device lookup failures**

With --stay-on-filesystem, if crossdev::init fails while symlink_metadata can still read the root (for example, an explicitly supplied dangling symlink), replacing the error with device ID 0 causes the valid root metadata to fail the same-device check. The command then reports zero bytes and no I/O error instead of retaining the previous nonzero error count and exit status; the same fallback is also used by background traversal. Treat the initialization failure as a per-root error rather than inventing a device ID.

Summary

  • Count aggregate root-device initialization failures and preserve ordered output.
  • Propagate background root-device initialization failures through traversal completion.
  • Keep successful background roots compactly indexed when failed roots are skipped.

Validation

  • cargo test --all-targets
  • cargo clippy --all-targets -- -D warnings
  • cargo fmt --check
  • Codex review for each commit hash

Byron and others added 2 commits August 3, 2026 06:09
<!-- agent -->
A failed root-device lookup was replaced with device ID zero after the parallel
traversal rewrite. For a dangling symlink, symlink metadata remained readable
but failed the device check, hiding the initialization error and producing a
successful exit status.

Count the lookup failure on its root, mark that root complete for ordered
output, and omit it from traversal. Flush completed roots after traversal
because failed roots emit no completion event.

Keep all roots in the shared
parallel traversal pool; when hard links are deduplicated, per-root attribution
is scheduling-dependent while the total remains correct, in the name of performance.

Assisted-by: GPT 5.6
Co-authored-by: GPT 5.6 <codex@openai.com>
<!-- agent -->
Background traversal replaced failed root-device lookups with device ID
zero. Readable root metadata could then be rejected as cross-device while the
traversal incorrectly retained a successful error count.

Skip roots whose lookup fails and carry their per-root errors in the traversal
completion event, restoring the previous statistics and exit status. Keep
interleaved overlapping and duplicate roots isolated by including each root path
Arc allocation in private directory-map keys while preserving public traversal
event types.

Assisted-by: GPT 5.6
Co-authored-by: GPT 5.6 <codex@openai.com>
@Byron
Byron marked this pull request as ready for review August 3, 2026 04:09

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b4d944ea98

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/traverse.rs
@Byron
Byron merged commit d7b1503 into main Aug 3, 2026
2 checks passed
@Byron
Byron deleted the crossdev-fix branch August 3, 2026 04:50
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