Skip to content

fix: check ignored errors in journal, bitmap, refcount and more - #31

Merged
mattmattox merged 1 commit into
mainfrom
claude/errcheck-paydown
Oct 24, 2026
Merged

mattmattox merged 1 commit into
mainfrom
claude/errcheck-paydown

Conversation

@mattmattox

Copy link
Copy Markdown
Contributor

Fixes all 175 errcheck findings in internal/{journal,bitmap,refcount,trim,superblock,storage,node,metrics} and cmd/crctest, and enforces errcheck there with a path-except rule.

Behavior changes worth reviewing:

  • journal: a batched Commit returned nil even when its batch sync failed. It now returns the sync error. Stop leaves the journal dirty if the final flush fails, so the next mount replays it. TestBatchCommitReturnsSyncError fails on main.
  • bitmap: a failed Alloc rollback leaked blocks without saying so. The error now names them.
  • Lock releases: a failed Release is logged rather than propagated, because it runs in a defer after the work has succeeded.

Remaining errcheck: 303. tests/integration 61, snapshot 48, goclusterfs 46, dir 40, extent 26, lock 25, tests/benchmark 23, inode 14, fsck 8, sfb 3, cache 3, cache/broadcast 3, cmd/mount 2, cmd/fsck 1.

Tests on .68: unit tests with -race pass, and the integration suite (-short) passes.

🤖 Generated with Claude Code

…, trim, superblock

Production fixes:
- journal: a batched Commit returned nil even when the batch sync
  failed. Waiters now get the sync error, the timer path logs it, and
  Stop reports a failed final flush and leaves the journal dirty so the
  next mount replays it.
- bitmap: a failed Alloc rollback leaked blocks silently; the returned
  error now names each block it could not free.
- bitmap, refcount: a failed lock Release is logged.
- node: a boot ID that fails to decode reads as unknown instead of half
  decoded; a slot that cannot be cleared after replay is logged.
- storage, journal recovery: cleanup Close errors are discarded or
  logged.

Tests check setup errors and discard cleanup errors explicitly.
errcheck is now enforced in these packages and in internal/metrics and
cmd/crctest; 303 findings remain elsewhere.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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