Skip to content

Analyses / Filesystem recovery

F2FS: when a successful fsync is not a recovery promise

Published 15 October 2026 / Updated / Linux source audit and research review

In the audited Linux v6.12 and v6.16 regular-file path, F2FS can return success from fsync with checkpointing disabled, before writing the recovery metadata handled later in that function. A zero return must be interpreted alongside the filesystem configuration, not used as a configuration-independent recovery promise.

On this page11 sections

Two ways to make a recoverable state

F2FS is a Linux filesystem designed for flash-backed block devices. Lee and colleagues' FAST 2015 paper distinguishes a consistent checkpoint from later file updates recovered through a separate mechanism. Its design alternates checkpoint packs, retaining a stable recovery point while constructing another. [1, section 2.7]

Making every small synchronized write checkpoint unrelated metadata would be expensive. Roll-forward recovery instead uses specially marked node blocks to reconstruct selected post-checkpoint updates. This is recovery work, not a rule that every byte written after a checkpoint must survive. [1, section 2.7.2]

The implementation still has a full-checkpoint fallback: the v6.12 source checks conditions including hard links, compressed files and insufficient roll-forward space. "fsync always checkpoints" and "fsync never checkpoints" are both too broad. [3, need_do_checkpoint]

Why a moved node need not move its ancestors

Out-of-place writing changes addresses. If an index stores a child's address, relocating that child can force the index itself to move, propagating changes upward: the wandering tree problem. F2FS inserts a Node Address Table (NAT) between a node identifier and its location. Indirect nodes store node IDs, while direct nodes store data-block addresses. [1, section 2.2]

Illustrative addresses, not an execution trace: a parent refers to node 42; NAT maps 42 to block 100. Moving that node to block 700 changes the mapping to 42:700 without changing that parent reference. Updating a data-block address still changes its containing node. The example explains indirection, not a fixed number of physical writes or a measured speedup.

Three metadata roles, not three interchangeable maps.
StructureQuestion it answersBoundary
NATWhere is this node ID's node block?Not a map of the controller's NAND pages.
SITWhich blocks in this segment are marked valid?Allocation validity is not payload checksum verification.
SSAWhich node owns or identifies this block?Ownership metadata is not a payload backup.

These roles follow the documented disk layout. [2] The v6.12 format makes the distinction concrete: SIT carries a validity bitmap and segment age, whereas a data summary carries a node ID and an offset within that node. Node-block summaries have a different interpretation. [7]

There is also a time boundary. The in-memory segment entry has separate current and checkpoint-valid maps and counts; these are allocator bookkeeping, not two interchangeable snapshots. [8] A dump of the current allocation view is therefore not interchangeable with the checkpoint-related protection state. In particular, new allocations can add protection bits before the next checkpoint, as explained below. NAT copy selection similarly depends on a bitmap in current_nat_addr; there is no rule that the higher-addressed copy is the correct one. [9]

What this optimizes: node indirection limits address-change propagation. It does not abolish cleaning or checkpoint work. The original design journals small NAT/SIT updates to avoid rewriting whole table blocks for every changed entry. [1, section 2.7.1] Our engineering conclusion is to separate metadata propagation, recovery work and device-level amplification when interpreting a benchmark. No runtime or crash-recovery experiment was performed for this extension.

ReconFS: fewer metadata writes, more reconstruction work

ReconFS, presented at FAST 2014, separates the live namespace from its persistent checkpoint. Reverse indices restore connectivity; compact logs restore changed metadata. Version checks reject obsolete pages after identifier reuse. Checkpointing remains necessary for zone switches and log truncation. [12, sections 3.1-3.4]

A hardware assumption is not a universal SSD guarantee. The design assumes atomic page updates and access to page metadata. It targets namespace consistency, not application data transactions. Its Linux 3.10.11 evaluation uses block-trace write volume as an endurance proxy, not measured NAND wear. [12, sections 2.2, 3.3 and 5.1-5.2] We therefore do not translate its write reduction into extra drive lifetime.

F2FS instead uses NAT indirection to contain address-update propagation and retains distinct checkpoint and roll-forward paths. [2, design and mount options] This is a mechanism comparison, not a present-day performance ranking. In our assessment, a useful evaluation must report foreground writes, checkpoint work and recovery scanning separately, then verify the device contract. Lower write traffic alone does not establish recoverability. No prototype execution or new benchmark was performed for this comparison.

Invalid does not mean reusable yet

A cleared current-valid bit is not enough. In the reviewed v6.12/v6.16 SSR path, a position must be clear in both cur_valid_map and ckpt_valid_map to pass the free-slot bitmap scan. This is a necessary condition within that scan, not a promise that the allocator will select the segment. [10, __next_free_blkoff]

The FAST paper describes threaded logging into holes in used segments, trading cleaning work for less sequential writes. [1, section 2.6] Slack space recycling (SSR) is the implementation path examined here. A filesystem hole in this discussion is an available segment position, not a sparse-file hole or an erased physical NAND page.

The subtlety is that the protection map can grow. With checkpointing enabled, allocation sets a bit in ckpt_valid_map; subsequent invalidation clears current validity without clearing that bit. Calling this map a frozen image of the last checkpoint is therefore misleading. The v6.16 code separates allocation and release helpers but retains this distinction. [11]

A small, reproducible counterexample

Our illustrative model starts with eight positions, numbered 0 through 7, and both maps marking 0 and 1. It then invalidates 0, allocates 2 and invalidates 2. No filesystem is mounted. The table is generated from the model, not from a kernel trace or a disk-capacity measurement.

Same operations, different protection state. The final row additionally models a completed checkpoint in enabled mode.
Checkpoint modeCurrently invalidPass the bitmap guardCandidate positions
Enabled7 of 85 of 83, 4, 5, 6, 7
Disabled7 of 86 of 82, 3, 4, 5, 6, 7
After checkpoint7 of 87 of 80, 2, 3, 4, 5, 6, 7

Position 0 stays protected in both first rows. With checkpointing disabled, the new allocation at 2 does not gain that protection bit, so invalidating it makes it a candidate again. [11] The completed-checkpoint abstraction refreshes protection from current validity; the SIT serialization helper copies that map, but calling the helper alone is not evidence of a durable checkpoint. [8, seg_info_to_raw_sit]

Do not turn these counts into free disk space. Segment choice, reserved capacity, concurrent operations and device constraints are excluded. The model does not reproduce ckpt_valid_blocks counters, roll-forward replay or failed checkpoints. Disabled checkpointing changes recovery semantics; the extra candidate is not a tuning recommendation.

Download the model, tests and generated states. Run node --test f2fs-reuse-model.test.mjs with all three in one directory. Tests compare every pair of eight-position binary maps, 65,536 pairs, against a separate bit-mask oracle. That checks the example's arithmetic, not the correctness of the kernel implementation.

Keep the two adaptive-logging workloads separate

The original paper's Figure 8 compares different workloads, not just different fill levels. [1, section 3.2.5]

FAST 2015 Figure 8: reported results, not a new benchmark.
Panel and workloadInitial fillReported outcome
8(a): fileserver94%Adaptive F2FS maintained at least twice EXT4 throughput across four rounds.
8(b): iozone random writesApproximately 100%Normal F2FS fell below 5% of EXT4 throughput from round 3; adaptive F2FS later approached EXT4.

SSR avoids first cleaning the selected segment; it does not eliminate device garbage collection. The iozone discussion explicitly includes that device cost. These workload-specific comparisons are not a universal occupancy threshold. [1, sections 2.6 and 3.2.5]

The configuration trap: checkpoint=disable

The Linux 6.12 manual documents that, while checkpointing remains disabled, unmounting or unexpected shutdown exposes the state from when this mode was entered. It also warns of temporarily unusable capacity. This changes the recovery contract; it is not simply a longer checkpoint interval. [2]

Our source inspection follows the regular-file path through f2fs_do_sync_file: it calls file_write_and_wait_range, then returns that status when SBI_CP_DISABLED is set. Successful data writeback therefore permits zero here without the later recovery-node and flush handling. Calling this an unconditional no-op would also be wrong: the writeback step precedes the return. [4]

Scope matters: directories branch to a different label before this sequence. The finding is not a claim about every directory sync, ioctl or vendor kernel. It describes the reviewed regular-file branch, not a newly discovered default-mode filesystem defect. [3]

Generated source observations, not power-loss measurements.
Upstream tagData writeback firstDisabled-checkpoint returnDirectory path
v6.12YesReturns writeback statusSeparate branch
v6.16YesReturns writeback statusSeparate branch

The mount code supplies the other half of the explanation: a checkpoint carrying CP_DISABLED_FLAG skips the normal fsync-data recovery path. Physical data writes and reconstructing the newer filesystem view are different events. [5]

Three switches, three different questions

Configuration boundaries; these are not tuning recommendations.
PolicyBoundary it changesDo not infer
checkpoint=disableAdvancement of the filesystem recovery point.That successful regular-file fsync preserves the newer view. [4]
norecoveryRoll-forward recovery on mounting; the documented option requires read-only use.That missing post-checkpoint updates were never written. [2]
fsync_mode=nobarrierThe documented policy omits flush commands for non-atomic files.That write completion proves volatile device caches are persistent. [2]

There is another subtle limit: disabling roll-forward does not mean skipping every mount-time action. In v6.16, orphan-inode recovery occurs before the branch that selects fsync-data recovery. A replay option alone is not a forensic write-blocking guarantee. [5] Compare the separate Btrfs read-only and replay boundaries.

Max: parallel logs still need a recovery order

Max (ATC 2021) partitions F2FS-derived indexing and allocation. File flushes select independent minor logs, so versions of one inode can land in different logs. Recovery merges their inode lists using embedded global versions after loading a checkpoint. [13, sections 4.2-4.4]

This is distinct from the later F2FSJ metadata-change journal described below. Nor does changing Linux 6.12's active_logs option install Max: that documented option selects 2, 4 or 6 active logs. [2] [6]

A rename across logs

Following Figure 4, inode 4 first names A/b at version 1, then B/b at version 2. Inode 3 names A/a. Our selection-only example permutes the three already eligible records; it does not run Max.

Six exhaustive scan orders, not a failure-rate estimate.
Selection ruleKeeps B/bKeeps stale A/b
Highest version per inode6 of 60 of 6
Last record scanned3 of 63 of 6

Download the model, tests and generated results. Run node --test model.test.mjs and node model.mjs --check with all three files together. Every subset and permutation of a four-record fixture is also compared with an independent maximum-selection oracle.

Finding the records comes before selecting their versions. The paper retains garbage collection for inode logs even under SSR: reusing obsolete inode positions can break the recovery chain. [13, Figure 5] Version comparison cannot recover a record that traversal never finds. The model assumes a fixed checkpoint epoch and eligible whole records; inode reuse, torn writes, log traversal, GC and complete namespace reconstruction are excluded. It is neither a crash test nor a proof of the filesystem.

What the newer paper does, and does not, establish

Cui and colleagues' OSDI 2025 F2FSJ work replaces coarse checkpoint work with decentralized, epoch-based metadata-change journaling. Section 5 evaluates a prototype on Linux 5.15.39; the end-to-end comparison uses F2FS POSIX mode. Reported measurements average at least ten runs. [6, sections 5.1-5.3]

For four Filebench metadata workloads, section 5.2 compares F2FS checkpoint time with F2FSJ journal time, reporting ratios up to 4.9. That is a component-time comparison, not a universal 4.9-fold application speedup. The authors also discuss recovery ordering in section 2.3. These findings motivate testing a concrete configuration; they do not establish identical behavior on every later kernel. [6]

We did not reproduce F2FSJ or measure storage performance. The older FAST paper explains the architecture; the newer paper evaluates an alternative; our pinned code audit establishes a narrower implementation fact. Those evidence types should remain separate.

Reproduce the source check

Run node audit-f2fs-sync.mjs using the audit script. It downloads two pinned source files, records their SHA-256 hashes and checks ordered landmarks within the named function. The generated JSON records the actual generation time and scope.

The checker fails when the expected branch structure changes. It is a bounded lexical audit, not a C parser or proof that all runtime paths are correct. Distribution backports require their own inspection. No filesystem was formatted, mounted, repaired or power-cut for this publication.

An evidence checklist before a benchmark

Hesela's engineering conclusion is to define the recovery promise before comparing latency. Record the kernel build, effective mount options, exact operation and return value, device-cache assumptions, and whether recovery was deliberately skipped. A faster result under a weaker promise is not an equivalent performance result.

For future disposable crash tests, distinguish acknowledged file updates, durable directory entries, checkpoint-only views and normally recovered views. State the expected outcome before injecting faults. That is a proposed validation protocol, not an experiment completed here.

Related: failed fsync and retry ambiguity, crash-test oracles, and device flush and FUA.

Primary sources

  1. Lee, Sim, Hwang and Cho (2015). F2FS: A New File System for Flash Storage. FAST 2015, sections 2.1-2.2, 2.6-2.7 and 3.2.5.
  2. Linux 6.12 F2FS documentation: checkpoint, recovery and fsync mount policies.
  3. Linux v6.12 fs/f2fs/file.c: f2fs_do_sync_file and checkpoint fallback.
  4. Linux v6.16 fs/f2fs/file.c: regular-file writeback and SBI_CP_DISABLED return.
  5. Linux v6.16 fs/f2fs/super.c: mount-time recovery and disabled-checkpoint state.
  6. Cui, Wang, Chen and Shao (2025). Decentralized, Epoch-based F2FS Journaling with Fine-grained Crash Recovery. OSDI 25, sections 2.3 and 5.1-5.3.
  7. Linux v6.12 include/linux/f2fs_fs.h: NAT, SIT and summary entry formats.
  8. Linux v6.12 fs/f2fs/segment.h: seg_entry and current/checkpoint validity maps.
  9. Linux v6.12 fs/f2fs/node.h: node_info, current_nat_addr and next_nat_addr.
  10. Linux v6.12 fs/f2fs/segment.c: update_sit_entry, __next_free_blkoff and change_curseg.
  11. Linux v6.16 fs/f2fs/segment.c: separate allocation/release helpers and SSR free-slot selection.
  12. Lu, Shu and Wang. ReconFS: A Reconstructable File System on Flash Storage. FAST 2014, pp. 75-88, sections 2.2-5.4.
  13. Liao, Lu, Xu and Shu. Max: A Multicore-Accelerated File System for Flash Storage. USENIX ATC 2021, pp. 877-891, sections 3-4.

Reviewed . Upstream tags are pinned, not claims about the newest release. No DOI is asserted where none was verified in the publisher record.

Published by Hesela team · Published · Updated

Report a correction · Editorial standards · Reuse guidance

Change history

: first published.

: latest recorded update. A detailed change note is not available for this revision.

New-publication RSS · Correction RSS

Cite this page
Hesela team. F2FS: when a successful fsync is not a recovery promise. Hesela. 2026-12-01. https://hesela.com/analyses/f2fs-checkpoint-fsync-recovery/