Skip to content

Clear a read-only tree without changing the mode of the files it links to - #2934

Merged
amankrx merged 2 commits into
TraceMachina:mainfrom
amankrx:fix/remove-dir-all-shared-inodes
Oct 13, 2026
Merged

amankrx merged 2 commits into
TraceMachina:mainfrom
amankrx:fix/remove-dir-all-shared-inodes

Conversation

@amankrx

@amankrx amankrx commented Oct 13, 2026

Copy link
Copy Markdown
Member

What and why

fs::remove_dir_all walks a tree whose removal failed on permissions and sets every regular file to 0600 along the way. A worker's tree is hardlinks to CAS blobs (0444) and executable variants (0555) that other actions share, so that chmod changes the shared inode: an executable variant loses its execute bit under every action still running it, the class of bug seen in #2347. It only triggers on a tree holding a read-only directory, but the worker now clears a partly built tree between input fetch attempts (#2932), which adds a call site.

Files are no longer touched. Unlinking needs write and search permission on the directory, never on the file, so the directory chmod the walk already does is all a read-only tree needs.

How was this verified?

New test: a tree with a read-only directory holding hardlinks to a 0555 blob outside it is removed, and the blob keeps 0555. The existing read-only test still passes; nativelink-util suite and clippy pass.

Risk

Low. A tree whose files were themselves the obstacle never existed: file modes do not gate unlink.

AI assistance

An agent drafted the change and I reviewed every line.

@vercel

vercel Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
nativelink Ready Ready Preview Oct 13, 2026 6:26pm UTC
nativelink-aidm Ready Ready Preview Oct 13, 2026 6:26pm UTC

Request Review

@amankrx
amankrx merged commit c6ae7d1 into TraceMachina:main Oct 13, 2026
38 of 39 checks passed

This branch was successfully deployed

2 active deployments
Preview – nativelink — 9b346b38 Deployed Oct 13, 2026 by vercel[bot]
Preview – nativelink-aidm — 9b346b38 Deployed Oct 13, 2026 by vercel[bot]
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