Analyses / Filesystem recovery
Ext4 journal replay: why old writes must sometimes be skipped
Published / Updated / Source review and constructed model
Recovery is not simply copying every old journal entry back to disk. Reused blocks need protection from obsolete images, and recovery itself may be interrupted. Ext4 uses revocation and replayable outcomes; orphan cleanup separately finishes pending inode reclamation.
On this page22 sections
The filesystem behind the journal
Ext4 belongs to the extended-filesystem family. Block groups organize its storage, while extent mappings describe runs of file blocks. These structures explain where data belongs; the journal explains how selected changes can be recovered after interruption. [24] [23]
Check the filesystem's features before choosing a recovery model. The has_journal feature records whether it has a journal; an ext4 filesystem without that feature does not acquire JBD2 recovery simply from its name. The journaled configurations below also depend on data mode and inode settings. [23] [20] Filesystem consistency and application durability remain separate questions.
A read-only mount is not necessarily a no-write inspection. Ext4 can replay its journal and write to the underlying storage even when mounted read-only. The documented ro,noload combination suppresses journal loading. After an unclean shutdown, however, skipping replay can leave inconsistencies; it is not a repair. [25] Record whether you examined unreplayed state or a recovered copy. Compare the read-only mount scope.
Changing a UUID can rewrite metadata checksums
A filesystem UUID is an identifier, not a file-content digest. On ext4 with metadata_csum, changing it can affect more than the identifier field. Without metadata_csum_seed, e2fsprogs derives its metadata checksum seed from the UUID and schedules checksum rewriting for a UUID change. With that feature, it uses the stored seed instead. The superblock's own checksum still covers its UUID-containing bytes. [Checksum code] [UUID-change code]
Feature constraints still apply. The stable_inodes feature prohibits UUID changes, including when a stored seed is present. The manual's mounted-change capability for metadata_csum_seed is conditional. These observations do not authorize editing an original recovery image. Keep the acquisition unchanged and make operational identity changes on a separate working copy. [Feature manual] See image provenance.
Four offline image observations
We used e2fsprogs 1.47.0 on four disposable 16 MiB regular-file images, with 4096-byte blocks, metadata_csum enabled and no journal. Each starts with the same explicit UUID and known file payload; we compare each image against its own pre-change bytes, not against another formatted image. The cases cover both seed settings with stable inodes enabled or disabled; separate formatting runs can also differ in timestamps and generated metadata.
| Checksum seed | Stable inodes | UUID change | Changed 4 KiB blocks |
|---|---|---|---|
| UUID-derived | Disabled | Succeeded | 8 |
| Stored | Disabled | Succeeded | 1 |
| UUID-derived | Enabled | Refused | 0 |
| Stored | Enabled | Refused | 0 |
Both permitted changes retained the extracted payload and passed e2fsck -fn. In the stored-seed case the captured differences were confined to the primary superblock; without it, bytes outside that superblock changed. Both refusals left the entire image unchanged. Each read-only inspection sequence also left the image bytes unchanged.
Limits: These small, clean, journal-free fixtures do not measure mounted behavior, interrupted changes, recovery completeness, hardware writes or performance. Block counts describe this capture, not a universal bound on UUID-change work. A successful filesystem check is not proof that arbitrary application data is correct.
Download the raw results, regular-file-only driver and offline regression tests. With the three files together, run python3 observe.py --check results.json and python3 -m unittest test_observe.py. To make fresh disposable fixtures with installed e2fsprogs, run python3 observe.py --output fresh.json. No input device or existing image path is accepted.
Commit and checkpoint are different boundaries
In the reviewed Linux v6.12 design, a committed journal transaction can recover changes whose final-location writes are incomplete. The scan establishes the accepted log boundary; checksum failure handling depends on the record and recovery pass, as detailed below. The default ordered mode journals metadata, not every file-data update. [1] [14]
In JBD2, a journal checkpoint writes committed buffers to their home locations, allowing the corresponding log space to be reclaimed. That is distinct from making the recovery information durable. [2] Neither event alone establishes an application's multi-file transaction boundary; compare atomic rename and directory durability.
DualFS makes the metadata log the home
DualFS removes a particular duplication: metadata is used directly from its log, without a second home-location write. Two partitions on one disk can separate it from regular-file data. This is a different filesystem design, not an ext4 option. [DualFS 2004, section 2.1]
| Design | Metadata path | Space reclamation |
|---|---|---|
| JBD2 | Journal, then home location | Checkpoint committed buffers |
| DualFS | Metadata log is the home | Clean segments, relocating live contents |
The JBD2 row follows its checkpoint contract. DualFS instead rebuilds IFile state by rolling forward after a checkpoint. It still has cleaning work. [2] [DualFS 2007, sections 6.3-6.4]
Fewer copies does not mean no extra writes. The 2004 design relocates metadata on reads to improve future prefetch locality. That can add writes even when an application is reading. [Section 2.2]
Check checksum coverage. The 2007 partial-segment checksum uses the first four bytes of each block, not all block contents. That mechanism must not be described as full-content integrity protection. [Section 6.1, p.270]
The 2004 evaluation uses Linux 2.4.19, an IDE disk and cold-cache runs. Disk I/O time and application performance are separate metrics. It cannot establish a current SSD performance ranking. [Sections 3-4] This is a source comparison, not a reproduced benchmark or crash test.
SpanFS: parallel journals still need a namespace protocol
SpanFS gives each domain its own journal and buffer-cache address space. Names crossing domains use reciprocal shadow and remote directory entries. Its 2015 prototype had static domain capacity; online block-group redistribution was future work. [SpanFS, sections 3.1-3.3]
In the paper's three-domain example, a distributed source and an absent destination require three ordered changes: add the new shadow, redirect the remote entry, then remove the old shadow. Reciprocal validity, not the number of stored names, determines which name survives. [Section 3.4.5]
| After commit | Stored shadows | Valid name |
|---|---|---|
| initial | old | old |
| add-new-shadow | old, new | old |
| retarget-remote | old, new | new |
| remove-old-shadow | new | new |
Our model checks all six orderings of these three whole-step transitions. Only the specified order keeps exactly one reciprocal name at every prefix. This is an exhaustive result for this tiny model, not proof of the filesystem: destination replacement, concurrency, torn writes and hardware persistence are excluded. Download the model, tests and results. Run node model.mjs --check and node --test model.test.mjs.
Parallel submission is not completed persistence. SpanFS separately requests relevant journal commits and waits for completion; its synchronization protocol can traverse ancestor directories. [Presentation, slides 27-33]
Keep benchmark populations separate. The later Max study evaluated SpanFS with 72 journals, Linux 4.19.11 and an Intel DC P3700. Its create/write/fsync/delete scaling experiment is a specific workload, not a universal ranking or a reproduction of the earlier hardware setup. [Max, sections 2 and 5] More CPU cores or device queues do not by themselves remove filesystem contention.
TxFS: journal atomicity is not application isolation
TxFS (ATC 2018) makes the missing boundary explicit. It combines private filesystem state with an application transaction API, then places each accepted transaction inside one journal transaction. Its stated isolation level is repeatable reads, not a blanket serializability claim. [TxFS, sections 3.1-3.3]
| Boundary | What it covers | What remains separate |
|---|---|---|
| Ext4 journal | Recovery of journaled filesystem changes | An application's multi-file transaction |
| TxFS transaction | Grouped filesystem operations with isolated private state | Synchronization of application memory |
| Sync inside TxFS | Success can precede transaction commit | Acknowledgement of the transaction outcome |
The first row follows the journal's documented coverage. The second follows the authors' distinction between filesystem isolation and user-level concurrency control. [1] [Author follow-up, p.14]
A successful inner fsync is not an extra durable commit. In the pinned prototype, do_fsync returns zero when current->in_fs_tx is set, before invoking vfs_fsync. Both fsync and fdatasync use that path. This is code inspection, not a running-kernel observation. [Pinned implementation]
The prototype limits a transaction to one process and one quarter of the journal's capacity; that fraction is not a user-payload allowance. Temporary files created and removed within a transaction can avoid persistence altogether. Such savings depend on the enclosing transaction, not on removing synchronization from ordinary ext4 programs. [Author follow-up, pp.14-15]
Reproduction boundary: the released repository contains a modified Linux 3.18.22 kernel and microbenchmarks. Its README does not supply the complete application evaluation. This is a research design, not a stock-ext4 mount option; no TxFS kernel or crash test was executed here. [Code and release scope]
Which writes does the journal protect?
The data mode changes journal coverage and write ordering, not the application's transaction boundary. This comparison follows Linux v6.12; the recovery models below do not test these modes. [16]
The table describes mount-level policy for ordinary, unencrypted regular files on a journaled filesystem. Per-inode settings and feature constraints can override it. When data journaling would otherwise be selected, Linux v6.12 uses ordered mode for fscrypt-encrypted regular files. Encryption alone does not change data=writeback to ordered mode. [20]
The per-inode EXT4_INODE_JOURNAL_DATA override also requires delayed allocation to be disabled in this selector. With no journal, its early return selects writeback handling. A mount option or inode flag alone is therefore incomplete evidence of the effective mode. [20]
| Mode | Journal contents | File-data relationship |
|---|---|---|
data=journal | Metadata and file data | Journal first, final locations later. |
data=ordered | Metadata | Associated data reaches storage before the metadata commit. |
data=writeback | Metadata | No corresponding data-before-commit requirement. |
Ordered does not mean every overwrite is ordered. In ext4_map_blocks, newly allocated visible blocks enter ordered-data handling; that branch excludes unwritten and explicitly zeroed mappings. Existing-block overwrites need not create the same allocation dependency. This source path does not promise all-or-nothing application updates. [17]
The guide documents that data=journal disables delayed allocation and O_DIRECT support. It does not establish a universal speed ranking. [16]
An O_DIRECT request can take the buffered path
Linux v6.12's ext4_dio_alignment returns zero for an inode whose data is journaled. ext4_should_use_dio then rejects the direct path, and ext4_dio_write_iter calls the buffered writer. An accepted O_DIRECT flag is not proof that the transfer bypassed the page cache. [21] [22]
The buffered writer rejects IOCB_NOWAIT with EOPNOTSUPP; earlier lock contention can instead return EAGAIN. These are different branches, not one promised error for every request. Reads also have a buffered fallback. [22]
For a benchmark, record the effective inode mode, request flags and observed I/O path. This is source review, not a kernel execution or throughput result.
Replacement heuristics have a narrower contract than fsync
Ext4 auto_da_alloc recognizes selected replacement patterns and forces delayed allocation for ordered-mode protection at the next journal commit. [16] In the reviewed rename path, the allocation call requires an existing destination inode and an enabled option. Renaming to an absent destination does not take that branch. [18]
Do not turn that heuristic into a promise that a successful rename has made the replacement durable. An application needs an explicit persistence protocol: synchronize the file, check errors, and synchronize the relevant directory after publication. File synchronization alone does not persist the directory entry. [19] See the replacement protocol and its failure boundaries.
For the different XFS checkpoint boundary, see XFS delayed logging and durable commits.
A checksum error does not mean zero replay writes
A journal checksum detects disagreement within its coverage. Linux v6.12 distinguishes scan, revoke and replay passes. Its error paths do not implement one universal transaction rollback rule. [14]
Source walkthrough of recovery.c, not injected failures.
| Check | Reviewed handling | Do not infer |
|---|---|---|
| Descriptor checksum | Outside scan, fail the pass. During scan, defer to commit-time checks for possibly stale journal blocks. | Every mismatch is a newly corrupted transaction. |
| Journaled block's tag checksum | Skip that image, remember an error and continue examining other images. | Nothing from that transaction reached its home location. |
| Commit checksum | Apply separate scan-boundary logic, including asynchronous-commit, stale-record and partial-commit checks. | A valid commit-block checksum validates every payload. |
After a replay error, jbd2_journal_recover still calls sync_blockdev. Successful block replays can therefore coexist with an overall failure. This is a source-level conclusion, not evidence that a damaged filesystem mounted successfully. [14]
Correction, 17 October 2026: the introduction previously said that any failed checksum disqualifies the whole transaction. That was too broad. Record the checksum type, pass and final error, not only the word corruption.
The same damaged tail can have two histories
Alagappan and colleagues' FAST 2018 paper explains why a persisted integrity record can coexist with either a crash-interrupted log entry or later corruption. Its CLSTORE design preserves an ambiguous final entry for protocol-aware recovery. The evaluation uses fault injection in LogCabin and ZooKeeper, not field failure rates. Its assumptions exclude undetectable checksum-consistent corruption. This historical finding is not a test of today's ext4. [15, sections 3.1, 3.3.3 and 5.1]
Hesela's constructed example uses a one-byte payload and a SHA-256 integrity record, independently written. The intended payload changes from 65 to 66. This is not JBD2's CRC32C record format.
Exactly 33 observed bytes per case. The two failing rows are byte-for-byte identical, not merely equal hashes.
| Constructed history | Payload byte | Checksum matches? |
|---|---|---|
| Payload and digest persist | 66 | Yes |
| Digest persists; payload update does not | 65 | No |
| Both persist; payload later changes to the old byte | 65 | No |
With only these bytes, an observer cannot choose between the two histories. An atomic-record guarantee, a trustworthy ordering witness or external history would change the assumptions. A mismatch detects disagreement; it does not itself establish when the damage occurred or authorize discarding acknowledged data.
Download the example, tests and generated results with code hash. Run adjacent files with node --test ambiguity.test.mjs. Tests enumerate all 65,280 distinct ordered one-byte substitutions. This finite counterexample is not a kernel simulation, a probability estimate or a CTRL replication.
Related: crash-corruption ambiguity, checksum identity limits and replica repair coverage.
A valid old image can be the wrong write
JBD2's revoke records prevent obsolete metadata images from overwriting newer data at a reused block. Recovery tracks the last revoking transaction for each block. Images at or before that transaction are skipped; a later image remains eligible. Revocation is not a permanent ban on using the block. [3]
Constructed example: block 42 already contains new user data. The validated, committed log holds an old metadata image at transaction 10 and a revocation at transaction 11. These are labels, not measured disk addresses.
| Replay rule | Final block 42 |
|---|---|
| Ignore revocation | old-metadata |
| Respect revocation | new-user-data |
| Then add an image at transaction 12 | later-metadata |
The last row is the essential control: a rule that skips every image of a revoked block would protect the reused data but wrongly suppress the later metadata. Our model tests both boundaries, including an image in the same transaction as a surviving revoke. Inputs represent the final accepted log, not operations before revoke cancellation.
Orphan cleanup is not journal replay or undelete
Unlink removes a name, but an open reference can keep the file alive after its last hard link disappears. A crash removes those live processes, leaving recovery to reclaim the abandoned allocations. [12] Ext4 also tracks linked files when truncation or extension cannot finish in one journal transaction. Thus an ext4 orphan inode is not necessarily a nameless file. [10]
Source walkthrough, not a crash experiment: Linux v6.12 ext4_process_orphan distinguishes two recovered inode states. [11]
| Recovered state | Cleanup action | What it does not establish |
|---|---|---|
| Link count is zero | Release the inode for deletion and reclaim its allocations. | Restoration of the removed name or secure erasure of old contents. |
| Link count is nonzero | Truncate excess allocation to the recovered inode size; retain the linked file. | Completion of the application's originally requested size or transaction. |
A cleanup counter is not a success certificate. In Linux v6.12, nr_truncates increments after the ext4_truncate error-handling branch too. If execution continues after an error, the final truncates cleaned up message can therefore include a failed attempt. Read it together with preceding errors; do not use the count alone to certify successful repair. This is a source-level inference, not an observed crash outcome. [11]
The ext4 orphan file changes how pending cleanup is recorded: inode-number slots replace reliance on one global linked list. Zero marks an unused slot. [10] The v6.12 insertion path can still fall back to the legacy list on ENOSPC; enabling the feature does not eliminate that path. Here the internal result can mean no orphan-file slots were available or a bounded slot search gave up, not necessarily filesystem-wide space exhaustion. This implementation uses the preallocated orphan file without dynamically growing it. Falling back is not itself proof that the application's operation failed. [11]
COMPAT_ORPHAN_FILE describes the feature, whereas RO_COMPAT_ORPHAN_PRESENT says entries may need processing, not that an orphan definitely exists. Clean unmount clears the latter. [10] An older kernel that does not understand a read-only-compatible feature cannot mount it read-write. Clearing this bit removes that particular compatibility barrier, not restrictions from other features or filesystem-checking tools. [13]
Read-only mount is not the same as a read-only device. The reviewed v6.12 cleanup function skips a read-only block device, but may temporarily clear the filesystem's read-only flag on writable media. Other error and feature checks can prevent cleanup. This historical source path does not guarantee that a particular kernel or damaged filesystem will mount successfully. [11] For preservation work, see read-only protection scopes.
Engineering implication: successful recovery can mean reclaiming space, not restoring deleted data. Treat orphan cleanup, accepted journal replay and application-level durability as separate questions. The existing model below excludes inode reclamation; these source findings do not extend its tested coverage.
Fast commit records recoverable metadata deltas
Ext4 fast commit records smaller metadata deltas for eligible ordered-mode updates. A full commit is still needed when the fast-commit space fills, an operation is ineligible or the commit timer fires; it invalidates preceding fast commits. This is a scoped Linux v6.12 design description, not a recommendation to enable it or a measured latency improvement. [1]
The implementation explains replay in terms of intended outcomes, including directory entries and inode state. Re-running a destructive procedure can remove its own previous result. Re-enforcing the recorded result can converge after another interruption. The source also lists replay-hardening work: its design explanation must not be read as a proof that every kernel failure path is correct. [4]
A free bitmap bit is not enough during replay
FastCommit's paper describes replaying the full journal before the later fast commits, with outcome-based records supporting repeated recovery. [6, section 5.5] Allocation needs another constraint: a block that currently looks free can already be named by an accepted fast-commit extent.
In Linux v6.12, the scan collects ADD_RANGE regions. A TAIL with the expected transaction ID and matching CRC advances fc_regions_valid. Merely encountering later bytes does not extend that accepted prefix. [Accepted-tail boundary]
The replay-only allocator checks bitmap-free candidates against the exclusion list and skips matches. This protects blocks needed by replay even before their final bitmap state is reconstructed. It is distinct from revocation, which suppresses obsolete journal images. [Replay allocator]
Constructed example, not a crash test. A single-block request searches blocks 40, 41 and 42 in ascending order; the last row has only 40 and 41. The accepted extent covers 40 and 41. Tail validity is supplied, not calculated.
| Rule | Chosen block | Meaning |
|---|---|---|
| Bitmap only (unsafe control) | 40 | Conflicts with accepted range |
| Accepted-range exclusion | 42 | Outside accepted range |
| Invalid suffix after valid tail | 42 | Suffix does not extend accepted range |
| Every candidate excluded | None | No eligible block in this toy pool |
In the third row, an invalid suffix mentions block 42 but does not extend the accepted exclusion set. In the last row, bitmap-free space exists yet this finite pool has no eligible candidate. Neither row predicts a real filesystem's mount result.
Download the inputs and results, model and tests. The model omits block groups, bigalloc clusters, concurrent updates and full replay state. The tests exhaust all 4096 six-block free/excluded mask pairs against a separate set oracle. These finite checks are not a proof of ext4 correctness or a measured performance improvement.
What else survives a file-level fsync?
iJournaling (ATC 2017) separates file-related commits from periodic compound journaling. Its recovery can omit contemporary unsynchronized files that normal journaling would recover. This reduces unwanted dependencies, but changes incidental persistence. [26, sections 5.1-5.3]
The FastCommit authors identify reliance on that incidental behavior as a compatibility concern, while acknowledging that the narrower behavior does not violate the fsync contract. Their evaluation excludes iJournaling because its code was unavailable to them. This is a design comparison, not a measured head-to-head ranking. [6, section 3 and section 4 footnote 4]
Later evidence uses a different implementation context. The FAST 2025 DJFS study does include iJournaling in its evaluation. Section 7.1 describes porting iJournaling, Ext4 and FastCommit to CXL.mem with 64-byte journal access on a 2 TB CMM-H prototype and an 88-core server. Those are adapted implementations, not a stock-ext4 comparison or a replay of the original 2017 experiment. The 2024 code-availability statement is therefore specific to that study; the 2025 evaluation does not by itself establish a public source release. [27, section 7.1]
Two papers need different block-count scopes
Source claims, not new measurements. The original paper describes a header and commit plus external extents, reports two-block cases, and separately proposes a one-block optimization. The later paper asserts a three-block minimum per commit without explaining that count there. [26, sections 5.2 and 6.4] [6, section 3]
| Evidence | Block count | Scope |
|---|---|---|
| Later-paper characterization | 3: At least | Per commit; block breakdown not supplied in that sentence |
| Described file-transaction layout | 2: Plus external extent blocks | Header and commit; directory transactions separate |
| Original authors' evaluation explanation | 2: Most cases | SQLite discussion; not a universal count |
| Proposed optimization | 1: Conditional possibility | No modified external extents or directory-entry blocks |
Do not turn the later comparison into a universal journal-block minimum. These descriptions need configuration and implementation evidence to reconcile; identical accounting is not established. Journal blocks do not count application data, subsequent full commits, device commands or NAND writes. A proposed optimization is not a measured result. Download the claim-level source table with page locators and PDF hashes and the later-study provenance.
Application implication: if an update to file B depends on file A, establish A's required durability explicitly; do not use fsync(B)as evidence that A survived. File and directory synchronization are separate obligations. This follows the documented API scope, not a new crash experiment. [19] See the existing replacement protocol.
Compact log records are not device write counts
Logical journaling describes recoverable object-level changes; physical journaling records changes in the on-disk representation. These are mechanisms, not exclusive filesystem labels: Linux's XFS design combines logical records, physical buffer changes and intents. Do not describe all of XFS as purely logical. [9]
Shirwadkar, Kadekodi and Tso's ATC 2024 FastCommit paper proposes compact logging, selective flushing and inline commits. Section 5.3's flush avoidance requires a single-block log and no data writes needing persistence. Its evaluation used GCE, Debian 11 and Linux 5.19; it is not a benchmark of the source versions below. [6]
Section 5.2, printed page 162: a check of the listed byte counts. Values are transcribed examples, not measurements. The sum is computed from downloadable inputs.
| Example | Listed bytes | Computed sum | Reported total | Difference |
|---|---|---|---|---|
| Append example | 12 + 20 + 136 + 12 | 180 B | 168 B | 12 B |
| Rename example | 12 + 16 + 16 + 136 + 12 | 192 B | 192 B | 0 B |
The append list and stated total disagree; the rename example is an agreeing control. We report the discrepancy without guessing which item the authors intended to change. This does not establish a serializer defect or invalidate the paper's measured results. [6] Neither sum is a measured block-device transfer size: padding, batching, data writes and later full commits must be accounted for separately. Journal bytes also do not measure internal NAND writes.
Check the kernel before promising fewer flushes
Our source check finds the same condition in Linux v6.12 and v6.16: ext4_fc_submit_bh requests both REQ_PREFLUSH and REQ_FUA for the tail when barriers are enabled. There is no single-block exception in that function. The reviewed implementation therefore does not justify a blanket flush-free claim from the paper's design description. [4] [7]
The v6.12 commit path also emits a HEAD tag only when s_fc_bytes is zero. This is another reason not to treat the paper's displayed component list as a measurement of every serialized commit. [4]
The block-layer contract distinguishes the two flags: preflush orders earlier completed writes onto nonvolatile storage before the payload, while FUA makes this request's completion depend on its own data being persistent. They can be combined. How many device commands follow depends on queue capabilities, including volatile cache and native FUA support. A flag count is not a hardware trace. [8]
Download the transcription, audit script and generated results with source hashes. Run adjacent inputs and script with node audit.mjs on Node 22 or later. It retrieves the PDF and two pinned source files, checks the named function and regenerates the JSON. A changed function shape fails the check rather than silently preserving the conclusion. PDF transcription was checked visually; the script does not parse the paper.
Before a performance comparison, record the kernel, filesystem options, cache capabilities, workload, fallback frequency, bytes and latency distribution. Preserve durability requirements across configurations. This audit mounts no filesystem, injects no failure and measures no latency; it is not a recommendation to disable barriers.
Lower mean latency can hide a worse p99
FastCommit's ATC 2024 evaluation reports an important trade-off. In its one-million-operation Varmail experiment over NFS, JBD2's mean fsync latency was 2.3 times FastCommit's, but JBD2's p99 was three times lower. The authors attribute FastCommit's longer tail to occasional fallback to larger JBD2 commits. Figure 12 and section 6.1 report this for Debian 11, Linux 5.19 and the paper's GCE setup, not all ext4 deployments. [6]
Engineering implication: lower average latency does not establish better tail latency. Compare the distribution and fallback frequency under the same workload and durability settings. We have reviewed the published result, not rerun this benchmark.
What happens if recovery crashes too?
Our namespace model starts with config pointing to inode 7 and temporary pointing to inode 9. The desired result is config=9, no temporary name, and one link to inode 9. It applies four outcomes: remove config; set config=9; remove temporary; set inode 9's link count to one. Names, inode IDs and the simplified state are illustrative.
Each row interrupts this model after a prefix, then restarts the complete outcome sequence. The link count column concerns inode 9 only. Intermediate state is not exposed as a valid recovered filesystem.
| Outcomes before interruption | Names at interruption | Names after recovery | Final link count |
|---|---|---|---|
| 0 | config=7; temporary=9 | config=9 | 1 |
| 1 | temporary=9 | config=9 | 1 |
| 2 | temporary=9; config=9 | config=9 | 1 |
| 3 | config=9 | config=9 | 1 |
| 4 | config=9 | config=9 | 1 |
The tests additionally enumerate all 25 ordered pairs of interruption prefixes before a final complete replay. Every case reaches that explicit target. A negative control instead deletes config and renames temporary: after one completion, repeating it deletes config and fails because the temporary source is gone. Merely retrying is not equivalent to idempotent recovery.
Download the generated results and code hash, dependency-free model and executable tests. Run the two adjacent JavaScript files with node --test journal-replay.test.mjs. These finite counts need no sampling interval; their relevance to real failure behavior is limited by the abstraction.
A model is not a filesystem certification
Pillai and colleagues' OSDI 2014 study separates application persistence properties from filesystem metadata consistency. BOB explored reordered block traces across six filesystems and sixteen configurations, respecting barriers. Section 2.2 explicitly distinguishes finding a counterexample from proving a property always holds. These historical experiments are methodological context, not evidence about fast commit in Linux v6.12. [5]
No filesystem was mounted or crashed for these examples. The earlier replay model excludes allocation, concurrent updates, inode reclamation, torn sectors, cache flushes, checksum validation, transaction-ID wrap and real journal parsing. Records are assumed already validated and committed. The namespace and block examples are separate models, not a combined ext4 recovery engine.
Our engineering conclusion: identify the accepted transaction range, reused-block rules and post-recovery application invariants separately. Test interruptions during recovery as well as during normal writes, using a disposable environment. A completed mount or a valid checksum is not by itself the application's correctness oracle.
Related: crash-test oracles,checksum identity limits and database WAL checkpoints. For a different approach to safe metadata updates, see soft updates and dependency ordering.
Primary sources
- Linux v6.12: ext4 Journal (jbd2), layout and fast commits
- Linux v6.12: The Linux Journalling API, checkpointing
- Linux v6.12: fs/jbd2/revoke.c, recovery rules and jbd2_journal_test_revoke
- Linux v6.12: fs/ext4/fast_commit.c, replay idempotence and stated limitations
- Pillai, Chidambaram, Alagappan, Al-Kiswany, A. C. Arpaci-Dusseau and R. H. Arpaci-Dusseau. All File Systems Are Not Created Equal: On the Complexity of Crafting Crash-Consistent Applications. OSDI 2014, pp. 433-448, section 2.2.
- Shirwadkar, Kadekodi and Tso. FastCommit: resource-efficient, performant and cost-effective file system journaling. USENIX ATC 2024, pp. 157-171, sections 5.2, 5.3 and 6.
- Linux v6.16: ext4_fc_submit_bh tail request flags
- Linux v6.12: explicit volatile write back cache control
- Linux v6.12: XFS Logging Design, introduction
- Linux v6.12: ext4 orphan-file layout and recovery flags
- Linux v6.12: ext4_orphan_add, ext4_process_orphan and ext4_orphan_cleanup
- Linux man-pages: unlink(2), names and open files
- Linux v6.12: ext4 superblock feature compatibility
- Linux v6.12: JBD2 recovery passes, checksum failures and writeback
- Alagappan et al. Protocol-Aware Recovery for Consensus-Based Storage. FAST 2018, pp. 15-32.
- Linux v6.12: ext4 data modes and auto_da_alloc
- Linux v6.12: ext4_map_blocks ordered-data registration
- Linux v6.12: ext4_rename delayed-allocation condition
- Linux man-pages: fsync(2), file data, directory entries and errors
- Linux v6.12: ext4_inode_journal_mode, encrypted files and per-inode overrides
- Linux v6.12: ext4_dio_alignment, data-journal exclusion
- Linux v6.12: direct-I/O eligibility, buffered fallback and NOWAIT errors
- e2fsprogs ext4(5): filesystem family, extent and has_journal features
- Linux v6.16: ext4 block-group organization
- Linux v6.16: ext4 read-only mounts, journal replay and noload
- Park and Shin. iJournaling. USENIX ATC 2017, pp.787-798; sections 5.1-5.3 and 6.4.
- Yoo et al. DJFS: Directory-Granularity Filesystem Journaling for CMM-H SSDs. FAST 2025, section 7.1, printed p.45.
- Hu et al. TxFS. USENIX ATC 2018, pp.879-891, sections 3.1-3.5 and 5.
- Hu et al. TxFS. ;login: Fall 2018, pp.12-15, isolation and limitations.
- TxFS f3f597d: fs/sync.c, do_fsync transaction early return.
- TxFS f3f597d: research kernel and released benchmark scope.
- Linux v6.12 fast_commit.c: accepted-tail range boundary and replay exclusions
- Linux v6.12 mballoc.c: replay-only allocator and excluded candidates
- Piernas, Cortes and Garcia. Traditional File Systems versus DualFS. IEICE E87-D(7), 2004, pp.1703-1711, sections 2-4.
- Piernas, Cortes and Garcia. The Design of New Journaling File Systems: The DualFS Case. IEEE TC 56(2), 2007, pp.267-281, sections 6.1-6.6.
- e2fsprogs v1.47.0 ext4(5): metadata_csum_seed and stable_inodes
- e2fsprogs v1.47.0: checksum seed initialization and superblock checksum
- e2fsprogs v1.47.0 tune2fs: UUID-change guards and checksum rewrite
- Kang et al. SpanFS: A Scalable File System on Fast Storage Devices. USENIX ATC 2015, sections 3.1-3.4 and 4.1-4.2.
- Liao, Lu, Xu and Shu. Max: A Multicore-Accelerated File System for Flash Storage. USENIX ATC 2021, sections 2 and 5.
- Kang et al. SpanFS presentation, ATC 2015, slides 27-33: parallel two-phase synchronization.
Updated . Data-mode and orphan cleanup reviews cover Linux v6.12; the cost audit covers v6.12 and v6.16; no unverified DOI, hardware measurement or independent reproduction is claimed.