Skip to content

fix(snapshot): hold the inode lock from read to write when marking a file shared - #100

Merged
mattmattox merged 1 commit into
mainfrom
fix/snapshot-inplace-race
Nov 13, 2026
Merged

mattmattox merged 1 commit into
mainfrom
fix/snapshot-inplace-race

Conversation

@mattmattox

Copy link
Copy Markdown
Contributor

The TODO race (a snapshot sharing a block between an in-place write's refcount check and its data write) is already closed. #42 re-checks under the shared inode lock and holds it until the data lands, and #29/#90 make that lock exclusive across nodes. TestSnapshotDuringInPlaceWriteAcrossNodes covers it.

While checking, I found a nearby gap: the mark wrote back a stale copy of the inode. TestSnapshotMarkKeepsConcurrentAppend fails 3/3 on agents-base: another node's acknowledged append loses its size.

10 instrumented VM snapshot-during-writes runs on .68: 100 snapshots unchanged, 0 double holds.

Not fixed here: two delete jobs for one snapshot can truncate a reused data inode.

🤖 Generated with Claude Code

…file shared

The mark read the source inode without a lock and wrote it back with only
an extent conflict check, so it undid any other change made in between,
such as another node's append size, mode or times.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mattmattox
mattmattox merged commit 9c19263 into main Nov 13, 2026
13 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