Repository navigation
fix(snapshot): keep each snapshot with the file it was taken of - #140
Merged
Merged
Conversation
Snapshots matched files by inode number alone, so a new file that reused a deleted file's inode slot listed its snapshots, could delete them, and could clone them, reading the deleted file's data. Inodes now record a birth generation when they take a slot, above every generation the slot's earlier files reached, and each snapshot records its file's. Listing, clone and delete through a file, and the API's file listing, match number and birth. Snapshots of deleted files, and those older versions wrote without a birth, are orphans: the API's full listing marks them, a delete without a path removes them, and fsck warns. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nings in VM fsck checks Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 14, 2026
mattmattox
added a commit
that referenced
this pull request
Nov 14, 2026
Since #140, bytes 26-27 and 32-35 hold the birth generation only with FlagHasTargetBirth. Without the flag, decoding ignores them and re-encoding writes zeros, so the checksum changes while every field stays the same. FuzzDecodeDescriptor compared the stored checksum too and failed on such descriptors; it now compares the fields. The input that found it is kept. 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.
Snapshots matched their file by inode number alone. After a file was deleted, a new file in the same inode slot listed its snapshots, could delete them, and could clone them, reading the deleted file's data.
TestSnapshotStaysWithItsFilereproduces this: before the fix, the new file listeds:activeand the clone and delete both succeeded.Design. The inode generations from #7 change over a file's life, so they can't identify a file on their own.
Orphans. A snapshot is an orphan when its file is gone, or when an older build wrote it without a birth generation.
GET /api/v1/snapshotsmarks orphans withorphan: true.DELETE /api/v1/snapshots/<name>withoutpathdeletes an orphan, and only an orphan.Upgrade impact. Existing snapshots become orphans after upgrade: they leave
getfattrlistings and can no longer be cloned. The CHANGELOG says so. The dashboard doesn't show orphans yet.Tested on .66.
go test -race ./internal/...: all packages pass after the test fix in db7eacc. goclusterfs took 351 s.🤖 Generated with Claude Code