fix(fs): preserve recursive delete child whiteouts#2056
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | f70db5b | Commit Preview URL Branch Preview URL |
Jun 12 2026, 10:11 AM |
There was a problem hiding this comment.
Pull request overview
This PR fixes OverlayFs recursive deletion semantics so that rm -rf <dir> preserves deletion intent for lower-layer children even if the parent directory is later recreated in the upper layer, preventing lower children from reappearing during overlay merges (and addressing the quota/threat-model scenario in #2047).
Changes:
- Materialize per-child whiteouts during recursive lower-directory deletion (
hide_lower_children_recursive) and ensure recursive delete enumerates lower children even when an upper directory exists. - Adjust
remove()logic so recursive directory deletes still traverse/deduct lower children, while avoiding double-deduction when an upper override already hides the lower entry. - Add regression test ensuring
rm -r /dir; mkdir /dirdoes not re-expose lower children.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Symlink and Fifo lower-layer entries were not getting per-child whiteouts during recursive delete (hide_lower_children_recursive) and were not being deducted from lower_hidden in remove(), allowing them to reappear and causing inaccurate usage accounting after parent directory recreation.
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.
Closes #2047
rm -rfon a directory was dropping whiteout entries for files deleted in child directories, causing them to reappear on VFS layer merge. Child whiteouts are now preserved during recursive deletion.Generated by Claude Code