Repository navigation
fix(fs): count a new file's open before its name appears - #171
Merged
Merged
Conversation
createFileOnce counted the caller's open only after adding the name and touching the parent. A peer that unlinked the name in that window left an orphan this node did not yet count as open, so its next orphan pass freed the file, and the caller's first write went to a freed or reused inode. The open is now counted right after the slot is claimed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
At 256 MB the volume has 257 one-MB blocks, so writes failed with ENOSPC under churn while peers had not yet let go of removed files; fsck showed no leak. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ight after its creation Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When the race detector's timing left the workload short of the chosen write, the EIO landed in fsck's repair, which then left orphans and blocks it should have freed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 the race #161's CHANGELOG named. createFileOnce counted the caller's open only after adding the name and touching the parent, and touchParent can block for hundreds of milliseconds when a directory is busy. A peer that unlinked the name in that window left an orphan this node didn't count as open, so this node's own orphan pass freed it before Create returned. The caller's first write then reached a freed slot, which #169 turns into ESTALE. A debug trace confirmed the creator freed it in all 5 cases.
History checker, 3 nodes for 3 minutes:
The torn reads are page-cache tears during a write on the same node. The next PR teaches the checker to accept them.
Also: the checker image goes to 1 GB. At 256 MB it had 257 blocks and filled under churn, with fsck clean. And the EIO sweep test now keeps its injected EIO out of fsck repair, a -race flake.
🤖 Generated with Claude Code