Journal checksum
A journal checksum is an integrity value computed over specified journal records or payloads to detect changes within that coverage.
Checksum coverage and recovery action depend on the journal format. In JBD2, descriptor, commit and journaled-block tag checks have distinct roles. A valid commit-block checksum does not by itself validate every journal payload. [1]
With JBD2 checksum v2, a block tag holds a 16-bit truncated crc32c of the journal UUID, sequence number and data block, while checksum v3 stores the full 32-bit value. Both versions store a crc32c of the UUID and commit block in the commit header. The v1, v2 and v3 formats are mutually exclusive. [3] [4]
In Linux v6.12, a journaled-block tag mismatch skips that image while remembering a recovery error. Other images can still be replayed, and final writeback is attempted even after a failed pass. A commit checksum failure on a block whose commit time is older than the previous transaction is treated as stale data and ends recovery without error. This is not a guarantee that mounting succeeds. [1]
Relations
- related
- Checksum, Journal checkpoint, Journal revoke record, Crash-corruption ambiguity, Optimistic crash consistency
Advantages
- Seeding the checksums with the journal UUID helps separate current records from blocks left by an earlier journal. [3, 1]
- The 32-bit tag of checksum v3 leaves fewer accidental matches than the truncated 16-bit tag of v2. [3]
Limitations
- A mismatch detects a change within the covered bytes but does not reconstruct the journaled block. [1]
- Without async_commit, a failed commit checksum stops the scan at that transaction and records it as the failed commit, while with async_commit the scan continues to the next transaction. [1]
Citations
- Linux v6.12: fs/jbd2/recovery.c
- Linux v6.12: include/linux/jbd2.h, commit header and block tag checksum fields
- Linux 6.12 documentation: ext4 journal (jbd2) on-disk format
Further reading
Sources & caveats
- recovery is fs/jbd2/recovery.c, re-read at tag v6.12 on git.kernel.org for tag verification, the stale commit-time rule and the async_commit branch.
- jbd2-h is include/linux/jbd2.h at v6.12, read for the 16-bit and 32-bit tag checksum fields and the commit header layout. ext4-journal is the Linux 6.12 ext4 journal documentation, read for the checksum feature flags.
- Behavior is scoped to the pinned Linux v6.12 source, not a fault-injection experiment or a guarantee about every filesystem.
- The filesystem-consistency-invariant entry links here because journal checksums are one mechanism for detecting records that would break such an invariant on replay.