Repository navigation
fix(snapshot): keep a descriptor's birth bytes when it has no birth flag - #158
Merged
Merged
Conversation
Without FlagHasTargetBirth, decoding skipped bytes 26-27 and 32-35 and re-encoding wrote zeros there, so every rewrite of an older descriptor changed bytes it never read. Decoding now always reads them into TargetBirth, which BelongsTo uses only with the flag, so a descriptor re-encodes to the bytes it was read from. FuzzDecodeDescriptor now checks exactly that, byte for byte, in place of comparing decoded fields with the checksum ignored. Seed 8ac4626f92ad713e fails the new check without this fix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mattmattox
added a commit
that referenced
this pull request
Nov 16, 2026
Every inode rewrite wrote reserved bytes 212-251 as zero. A future field there would be wiped whenever this build rewrote the inode, which is how older builds lost the birth generation at 196-203. The inode now keeps those bytes as read and writes them back, as #158 did for snapshot descriptors. Freeing or claiming a slot still starts from a zeroed inode. main is merged in, including #161. Holders keeps bytes 204-211, so Reserved is now 40 bytes (212-251). The merge commit holds that change plus the new test; the first commit's message still says 204-251. Tests: - FuzzDeserializeInode now checks the re-encoded bytes. Its seed sets both Holders and the reserved bytes. - New TestRewriteChangesHoldersAndKeepsReservedBytes: through the Table, a Holders change reaches disk and the reserved bytes survive. It fails if a rewrite puts back the Holders read from disk. - Fuzzed 3 min on .66 with no failures. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.
For #144. #146 unblocked the nightly by ignoring the checksum in the descriptor round trip. This fixes the cause and makes the check strict again.
Without FlagHasTargetBirth, every rewrite of an older descriptor zeroed bytes 26-27 and 32-35. Those bytes could hold an old extent tree root; nothing reads it, so no data was lost. FuzzDecodeDescriptor now requires a re-encode to write back exactly the bytes it read. Seed 8ac4626f92ad713e fails that check on main and passes here. The fuzzer then ran 10 min on .66 with no failures.
The other encoders I checked:
🤖 Generated with Claude Code