Repository navigation
test(fsck): free the blocks interrupted truncates and subdirectory unlinks leave - #75
Merged
Merged
Conversation
A node crashes after a truncate writes the shorter inode but before it frees the cut blocks. Since #65, replay frees nothing for that record, so the blocks stay allocated. The test stalls the truncate's free on a refcount lock another node holds, crashes by closing the device, replays the journal, and checks that fsck -repair frees exactly the 2 cut blocks and that both files keep their data. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…y behavior The truncate test required replay to leave the cut blocks allocated. A shared helper now accepts whatever of the released blocks replay leaves: check must name exactly those, repair must free exactly those, and the allocated set must end as before minus the released blocks. The test keeps passing once replay frees these blocks itself. The new test crashes while unlinking a file in a subdirectory, after its entry is gone and before its blocks are freed. Replay deletes the inode and frees nothing for the BlockFree record, so the blocks leak until repair frees them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 12, 2026
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.
Follow-up to #72, unblocked by #65. It covers the interrupted-free leaks that the reclaim was built for.
Dir.Unlinkofsub/victim.bin, after the entry is removed and before the frees. Replay deletes the inode and frees nothing forBlockFree.Both tests let replay leave any of the released blocks allocated. Check must name exactly those,
-repairmust free exactly those, and the allocated set must end up as before minus the released blocks. Today replay leaves blocks 2 and 3 in both tests, and repair frees them. Once per-node-journal makes replay free them, the tests still pass, and repair changes nothing. I checked that with a copy whose replay frees them.On .66 both tests pass 10/10 with
-race. The goclusterfs and fsck packages pass with-race, and lint and parity pass.🤖 Generated with Claude Code