Skip to content

fix(inode): write back the reserved bytes an inode was read with - #163

Merged
mattmattox merged 2 commits into
mainfrom
fix-inode-reserved-bytes
Nov 16, 2026
Merged

mattmattox merged 2 commits into
mainfrom
fix-inode-reserved-bytes

Conversation

@mattmattox

@mattmattox mattmattox commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

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

mattmattox and others added 2 commits November 16, 2026 13:24
Inode bytes 204-251 are unused, and every inode rewrite wrote them as
zero. A newer version that adds a field there would lose it whenever
this one rewrote the inode, as older versions lost the birth generation
at 196-203. Decoding now keeps them in Reserved, which encoding writes
back. Freeing or claiming a slot still starts from a zeroed inode.

FuzzDeserializeInode now checks that an inode re-encodes to the bytes
it was read from, and its new seed with reserved bytes set fails that
check without this fix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mattmattox
mattmattox merged commit 2a25dde into main Nov 16, 2026
17 checks passed
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.

1 participant