Repository navigation
fix: check ignored errors in dir and fsck; enforce errcheck there - #114
Merged
Merged
Conversation
- dir dropped the error from releasing a directory's inode lock in 12 places. ErrNotLockOwner means a double release, which may have dropped another holder's lock early so two writers rewrote the same directory block and lost entries. It is now logged as an error; other release failures log a warning. - dir logs a block that addToNewBlock could not free on cleanup; it stays allocated with no owner until fsck -repair frees it. - goclusterfs-fsck -list-slots and -release-slot return the first failed write. -release-slot no longer releases a slot whose plan it could not print. A failed device close is reported on stderr. - fsck's verbose progress output discards write errors explicitly. - Tests check setup steps and discard cleanup errors explicitly. errcheck now also covers internal/dir, internal/fsck and cmd/fsck; 341 findings remain elsewhere. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 13, 2026
# Conflicts: # .golangci.yml
# Conflicts: # internal/dir/dir.go
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 57 errcheck findings in
internal/dir,internal/fsckandcmd/fsck. 341 findings remain elsewhere.Config change: errcheck is now on everywhere. Each path that still has findings has its own exclusion rule in
.golangci.yml: api, cache, fileops, goclusterfs, sfb, cmd/gfsctl, cmd/mount, tests/benchmark and tests/integration. The old singlepath-exceptregex made every errcheck PR edit the same line, which is why #116 and #117 conflict now. From here on, a PR deletes its own rule, and the rules are separated by blank lines so those deletions merge cleanly. New packages get errcheck automatically.Ignored errors that could hide corruption or loss:
ReleasereturnsErrNotLockOwner, the lock was released twice. The extra release may have dropped another holder's directory lock early, letting two writers rewrite the same directory block and lose entries. This is the same handling fix: check ignored errors in lock, inode and extent; enforce errcheck there #95 and fix(snapshot): check ignored errors and enforce errcheck in internal/snapshot #108 gave the inode table and the snapshot registry.goclusterfs-fsck -release-slot: it now refuses to release a slot if printing the plan of what will be discarded failed. Before, the release went ahead even when the user never saw what it would discard.Smaller fixes:
dir.addToNewBlockcan't free its unused block on cleanup, it now logs that the block stays allocated with no owner.fsck -repairfrees such blocks (feat(fsck): free leaked blocks in -repair #72).-list-slotsand-release-slotreturn the first failed write. A failed device close is reported on stderr. fsck's verbose progress output discards write errors explicitly.Merged with main: after #112 and #97. The two
dir.goconflicts with #97 are resolved: #97'slogging.Debugflines are kept, and all lock releases still go throughunlock. #97's new packages have no errcheck findings.🤖 Generated with Claude Code