{
  "slug": "journal-checksum",
  "term": "Journal checksum",
  "aliases": [],
  "definition": "A journal checksum is an integrity value computed over specified journal records or payloads to detect changes within that coverage.",
  "note": "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. [recovery]\n\nWith 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. [jbd2-h] [ext4-journal]\n\nIn 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. [recovery]\n\nFile-data coverage: data=ordered and data=writeback use metadata-only journaling, unlike data=journal. A valid journal checksum therefore does not validate all file contents. Ordering protects a different dependency. [ext4-modes] A bounded state-enumeration guide shows how valid metadata and a commit can coexist with missing new data when required ordering is removed. [coverage-model]",
  "status": "shipping",
  "advantages": [
    {
      "text": "Seeding the checksums with the journal UUID helps separate current records from blocks left by an earlier journal.",
      "citationIds": [
        "jbd2-h",
        "recovery"
      ]
    },
    {
      "text": "The 32-bit tag of checksum v3 leaves fewer accidental matches than the truncated 16-bit tag of v2.",
      "citationIds": [
        "jbd2-h"
      ]
    }
  ],
  "limitations": [
    {
      "text": "A mismatch detects a change within the covered bytes but does not reconstruct the journaled block.",
      "citationIds": [
        "recovery"
      ]
    },
    {
      "text": "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.",
      "citationIds": [
        "recovery"
      ]
    }
  ],
  "related": [
    "checksum",
    "journal-checkpoint",
    "journal-revoke-record",
    "crash-corruption-ambiguity",
    "optimistic-crash-consistency"
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "citations": [
    {
      "id": "recovery",
      "title": "Linux v6.12: fs/jbd2/recovery.c",
      "url": "https://github.com/torvalds/linux/blob/adc218676eef25575469234709c2d87185ca223a/fs/jbd2/recovery.c",
      "accessed": "2026-10-23"
    },
    {
      "id": "hesela",
      "title": "Hesela: Ext4 replay, checksum failure paths and ambiguous tails",
      "url": "https://hesela.com/analyses/ext4-journal-replay-revocation/",
      "accessed": "2026-10-17"
    },
    {
      "id": "jbd2-h",
      "title": "Linux v6.12: include/linux/jbd2.h, commit header and block tag checksum fields",
      "url": "https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/jbd2.h?h=v6.12",
      "accessed": "2026-10-23"
    },
    {
      "id": "ext4-journal",
      "title": "Linux 6.12 documentation: ext4 journal (jbd2) on-disk format",
      "url": "https://docs.kernel.org/6.12/filesystems/ext4/journal.html",
      "accessed": "2026-10-23"
    },
    {
      "id": "ext4-modes",
      "title": "Linux v6.12 ext4 administration guide: Data Mode and journal_async_commit",
      "url": "https://docs.kernel.org/6.12/admin-guide/ext4.html",
      "accessed": "2026-12-04"
    },
    {
      "id": "coverage-model",
      "title": "Hesela: journal checksum coverage, executable counterexample and primary-source guide",
      "url": "https://hesela.dev/research/journal-coverage/README.md",
      "accessed": "2026-12-04"
    }
  ],
  "updated": "2026-12-04",
  "provenance": [
    "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.",
    "2026-12-04: data-mode scope checked against Linux v6.12 documentation. The linked Boolean model is an explanatory counterexample, not a kernel run, measured crash frequency or full OptFS implementation."
  ]
}
