Repository navigation
fix: check ignored errors in lock, inode and extent; enforce errcheck there - #95
Merged
Merged
Conversation
… there - inode table: a failed lock release after an inode or sector update was dropped. If another node had taken the lock over, both nodes may have written the same inode table sector. Now logged as an error with that reason; other release failures log a warning. - extent: when allocate or MapCopy fail, the blocks they took are freed again. A failed free left them allocated with no owner and no trace; the returned error now names each one. - lock.WithInodeLock now returns the release error. - Tests check setup steps and lock releases; lock tests use a release helper that reports failures with Errorf, so goroutines can use it. errcheck is now enforced in lock, inode and extent too; 438 findings remain elsewhere. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since #90 no node takes over a live node's lock. Release returns ErrNotLockOwner only when this node's own bookkeeping lacks the lock, a double release that may have dropped another holder's lock early. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mattmattox
added a commit
that referenced
this pull request
Nov 13, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mattmattox
added a commit
that referenced
this pull request
Nov 13, 2026
…eplay mkdir and claimed creates whole (#94) * fix(fs): remove a name only while it names the inode the lookup found Unlink and rmdir looked up the child, then removed the name and freed the child by that lookup. If another node removed the name and made a new one in between, they removed the new name and freed with stale extents. The removal now checks the child under the directory lock: a name that points to another inode returns ENOENT, and a changed child is looked up again. The free uses what the inode maps when it is freed. Name errors map to EEXIST and ENOENT. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(journal): replay a mkdir whole, and finish a create whose claim landed A replayed mkdir now gets "." and ".." and raises the parent's link count, under the parent's inode lock. A create that crashed after claiming its inode used to leave it unnamed: replay now names it when the logging node wrote it last, and no more often than a create does before naming it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test: unlink racing a peer's recreate, replayed mkdir and claims, and name errors Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(fs): unlink racing a peer that puts a directory in the same slot Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(dir): report a directory whose inode is already free as removed Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(journal): build the root with newRootDir now that replay sets up directories Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(fs): unlink frees blocks an open handle wrote after the name was removed Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(fs): let unlink proceed when another node only wrote the file Every write raises a file's generation, so unlink of a file another node kept writing ran out of retries with EAGAIN. A file now only has to keep its type and link count; a directory still has to be unchanged, since an entry added to it changes its generation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(inode): release the Update lock through t.unlock, as #95 does Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 13, 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.
Fixes all 83 errcheck findings in
internal/{lock,inode,extent}and adds those packages to thepath-exceptrule. journal, storage and refcount were already enforced by #31. 438 findings remain elsewhere.Ignored errors that could hide corruption:
inode.Tableupdates, inode and sector locks):ErrNotLockOwnerfromReleasemeans a double release or a lock bookkeeping bug. Since fix(lock): take over a lock only after its holder is released #90 that is the only cause; another node never takes over a live node's lock. The extra release may have dropped another holder's lock early, so two writers could have updated the inode table at once. This used to show only as a[DEBUG]line insidelock. It is now an[ERROR].extentallocate orMapCopy: if freeing them failed, they stayed allocated with no owner. That's a leak, not corruption. The returned error now names the blocks.lock.WithInodeLocknow returns the release error; nothing in production calls it.Tests: setup steps are now checked. Lock tests use a
releasehelper that reports withErrorf, so goroutines and defers can call it. Lint and unit tests with-racepass on .68.🤖 Generated with Claude Code