Skip to content

Research notes / Filesystem logging

XFS delayed logging: which commit is durable?

Published / Updated / Source review, not a benchmark

An XFS transaction can finish in memory before its recovery record is durable. A fast metadata operation is not automatically a fast durable operation.

On this page13 sections

Allocation and logging solve different problems

XFS is an extent-based filesystem that uses B-trees for metadata. Its data section is divided into allocation groups to allow parallel allocation work. It also has a log and can have a separate realtime section; the log itself can be internal or external. [11] [10]

Allocation groups are not independent copies of the files. Likewise, the metadata log is a recovery mechanism, not a journal of every ordinary file-data write. This distinction matters when interpreting commit: an internal metadata transaction can finish before its log record is durable, and that event is not an application-level durability acknowledgement. [1] The stages below follow Linux v6.16.

A read-only mount can still permit internal log-recovery writes. [15] XFS norecovery disables log recovery and requires read-only mounting. If the filesystem was not cleanly unmounted, that view can be inconsistent and some files or directories may be inaccessible. Disabling recovery does not make that view a repaired filesystem. [10] See the distinction between read-only mount scope and a no-write inspection.

What an allocation group makes local

An XFS allocation group (AG) partitions the data section's allocation work. Each group has headers leading to its free-space and inode indexes. The superblock, AGF, AGI and AGFL occupy fixed locations; most other metadata is allocated dynamically. Local indexes support concurrent allocation, not separate filesystems or redundant copies. [10] [12, Introduction]

The AGFL is not a list of all free extents. It provides reserve blocks for the free-space and reverse-mapping B-trees. The XFS_RMAP_OWN_AG owner code stays the same when a block moves from that reserve into one of these trees. Reading the owner code alone cannot tell whether the block is still on the list; inspection must also account for the live structures. [9, Rebuilding the Free Space Indices]

More groups do not guarantee better performance. The filesystem manual warns that an excessive count can increase CPU work, particularly near full capacity. AG count is an allocation-concurrency parameter, not a durability setting. For comparisons, report the geometry alongside directory sharing and synchronization frequency; changing the group count alone does not establish that logging contention was removed. [10]

Nor is an AG header lock a snapshot of a whole deferred update. In Linux v6.16, xchk_perag_drain_and_lock checks pending intents for AG-wide metadata inspection and can release locks, wait and retry. Inode-oriented checking can instead rely on its inode lock. This prevents treating every temporary disagreement between indexes as persistent corruption; it does not turn the AG into an application transaction. [16] See the online checker's observation boundary below.

A valid CRC is not a valid filesystem state

With metadata CRCs enabled, XFS uses CRC32c for metadata objects, not as a general file-content checksum. [13] Its self-describing metadata also records filesystem identity, block location and object-specific ownership. For example, copying an unchanged block to the wrong address preserves its CRC; a separate location check exposes the mismatch. An inode can own a file's extent-tree block, while an allocation group owns a free-space-tree block. [12, section 3.2]

These object checks do not establish every relationship between blocks. The XFS design explicitly separates stateless verification from stateful checks elsewhere in the filesystem. [12, section 3.3] A successful checksum, journal replay and a consistency check therefore answer different questions.

Fryer and colleagues' Recon study checked metadata invariants before transaction commit. Its evaluation used ext3, injecting targeted and random metadata corruption and comparing detection with e2fsck. Injection affected blocks already being modified; it did not test superblock corruption. [14, sections 2.1 and 5.2] This supports distinguishing checksums from consistency invariants, not a claim that Recon was evaluated on XFS. We have not reproduced that experiment or measured corruption-detection rates here.

The injector did not issue misdirected writes. Recon also assumed correct lower layers; a write targeting metadata before the checker knew its type could escape detection. [14, section 2.4] Keep that fault-model limit separate from XFS's block-identity checks.

Three boundaries, not one

Delayed logging coalesces repeated metadata changes before journal writes. The design distinguishes these stages. [1]

Conceptual stages; relogging can overlap them. Not a trace from a running filesystem.
StageEvidenceStill not established
In-memory commitCIL holds formatted changes.Journal persistence.
Checkpoint completionRecovery information reaches the journal; items enter the AIL.Home-location writeback.
Home writebackItems leave the AIL, permitting log-tail progress.Application-level multi-file atomicity.

Definitions: delayed logging, Committed Item List and Active Item List.

Relogging can release old log space without home writeback

Relogging carries forward an object's still-needed changes into a later journal transaction. Locked items must be relogged across rolling transactions: otherwise a space wait can depend on writeback that needs those same locks. [1, sections 1.6-1.7]

In Linux v6.16, xfs_trans_ail_update_bulk moves an existing item only to a newer LSN. Moving the oldest item can advance the AIL minimum; an equally old remaining item still holds that minimum. This is different from deleting the item after home writeback. [6]

Hesela illustration: Old/New are ordered labels, not measured offsets or a kernel trace. Only two active items are shown.
StatePQOldest
Initial stateOldOldOld
Move PNewOldOld, held by Q
Move QNewNewNew

The reserve grant head accounts for reservations; the write grant head governs physical log space. Regranting a rolling transaction may overcommit reservation accounting, not physical capacity. [1, section 1.6] These are internal progress rules, not permission for an application to omit synchronization.

Rolling transactions are not one atomic journal transaction

A rolling transaction commits one step and continues using a permanent log reservation. Holding an inode lock across the chain can hide intermediate changes from callers requiring that lock; it does not make the whole chain atomic in the journal. [1, sections 1.2-1.4]

Deferred operations split metadata work to respect lock ordering and reservation limits. They are not delayed logging, which batches journal output. [8] The intent/done protocol records work that recovery may still need to finish. [9]

  1. In an extent-free example, one transaction removes the mapping and records an Extent Freeing Intent (EFI).
  2. A later transaction updates free-space metadata and records the matching Extent Freeing Done (EFD).
  3. If recovery finds a persisted intent without its matching done, it completes the described work. This is completion, not rollback of the entire chain. [9, Discovery of the Problem]

Done does not always mean the logical operation is finished. When work needs another transaction, XFS records done for the old intent and a replacement intent for the remainder together. Their shared transaction preserves the handoff; -EAGAIN here requests internal continuation, not an application retry. [8, Requesting a Fresh Transaction]

An online checker has a different observation boundary

Allocation-group (AG) header locks are released between steps. An online checker can therefore encounter temporarily mismatched metadata structures. The design coordinates checking through intent counters and lock cycling, rather than interpreting every intermediate state as corruption. [9, Intent Drains]

These are internal recovery and observation rules, not a multi-file atomicity API or an application durability acknowledgement. This explanation reviews Linux v6.16 sources; it is not a crash-test result.

An LSN is not a universal byte counter

XFS encodes a cycle in the upper 32 bits and a block position in the lower 32 bits; the position uses 512-byte basic blocks. [7] [1, section 1.6] Keep the log geometry and wrap context: subtracting encoded values across a cycle boundary does not directly give bytes written.

The existing LSN definition now distinguishes XFS from PostgreSQL's byte-offset convention. A position alone certifies neither a durability barrier nor elapsed time.

A checkpoint means different work

JBD2 checkpointing writes already-committed buffers to their home locations and supports journal-space reclamation. [4] XFS calls its batched journal transaction a checkpoint. [1] Translating either word without naming the subsystem reverses the apparent direction of the write.

The journal-checkpoint glossary entry uses the JBD2 meaning. Compare ext4 commit and checkpoint.

What ScaleXFS tested

Kim and colleagues' FAST 2022 study used Linux 5.8.5; its evaluation used a four-socket, 112-core server, 512 GB DRAM and an Intel Optane 905p. It addressed logging contention with double CILs, per-core lists and strided accounting. This is a historical experimental configuration. [3, sections 4-5]

The workload details are decisive: modified varmail gave each thread its own directory; Exim disabled per-message fsync(). In FxMark's shared-directory case, the full design did not improve performance over XFS because shared-metadata contention remained. The private-directory gain was not universal. [3, sections 3.1 and 5.3, Figure 21]

Table 1 reports fsync() as 15.4% of system calls in modified varmail, 1.2% in dbench and 0% in mdtest. These are operation-mix fractions, not latency shares or durability probabilities. [3, Table 1]

Hesela's inference: compare concurrency and persistence requirements before comparing throughput. Disabling synchronization changes the question. These results do not establish a speedup on a current distribution, and we did not reproduce the experiments.

The newer source is not the paper's baseline

Our Linux v6.16 source check finds per-CPU item insertion in xlog_cil_insert_items and aggregation in xlog_cil_push_pcp_aggregate. It also checks that xlog_cil_flush initiates work without waiting for completion. A function named flush is not sufficient evidence of a synchronous durability barrier. [2]

This establishes selected source features, not that ScaleXFS was merged, that the implementations are equivalent, or that a bottleneck disappeared. Distribution backports also require separate inspection.

Download the source checker and generated receipt. Run node audit.mjs with Node 22 or later; it fetches the pinned source, reports SHA-256 and line locations, and fails if a checked feature is absent. It does not execute kernel code. To inspect a cached copy, pass its path as the first argument and compare its hash with the receipt.

Keep the application contract explicit

On Linux, successful fsync() covers file data and associated metadata; persisting the containing directory entry requires a separate directory synchronization. Errors must be checked. [5] Neither a benchmark's operation count nor an internal function return substitutes for that contract.

For an engineering comparison, record kernel and filesystem options, directory sharing, operation mix, synchronization frequency and latency distribution. Keep those inputs fixed while investigating the bottleneck. This is an editorial measurement checklist, not a tested tuning prescription.

Related: fsync failures and durable namespace updates.

Primary sources

  1. Linux v6.16: XFS Logging Design, asynchronous transactions, checkpoints and item lifecycle
  2. Linux v6.16: xfs_log_cil.c, per-CPU insertion, aggregation and asynchronous flush
  3. Kim, Min, Oh and Won. ScaleXFS: Getting scalability of XFS back on the ring. FAST 2022, pp. 329-344.
  4. Linux v6.12: The Linux Journalling API, checkpointing
  5. Linux man-pages: fsync(2), file and directory synchronization
  6. Linux v6.16: xfs_trans_ail.c, ordered item movement and log-tail updates
  7. Linux v6.16: xfs_log_format.h, CYCLE_LSN and BLOCK_LSN
  8. Linux v6.16: xfs_defer.c, deferred operations and atomic intent continuation
  9. Linux v6.16: XFS Online Fsck Design, transaction chains and intent drains
  10. xfsprogs xfs(5): allocation groups and filesystem sections
  11. Linux v6.16: XFS overview, extents, B-trees and filesystem sections
  12. Linux v6.16: XFS Self Describing Metadata, location, ownership and runtime validation
  13. xfsprogs mkfs.xfs(8): metadata crc option
  14. Fryer et al. Recon: Verifying File System Consistency at Runtime. FAST 2012, sections 2 and 5
  15. Linux v6.16: xfs_log_writable permits internal recovery writes on read-only mounts
  16. Linux v6.16: xchk_perag_drain_and_lock, AG-wide intent checks and inode-lock exception

Reviewed . No third-party figures reproduced.

Published by Hesela team · Published · Updated

Report a correction · Editorial standards · Reuse guidance

Change history

: first published.

  1. · Update: Explained XFS allocation groups and filesystem sections, then distinguished metadata CRCs, block identity and consistency invariants with scoped Recon evidence. Distinguished read-only replay from norecovery and its inconsistent view.

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

New-publication RSS · Correction RSS

Cite this page
Hesela team. XFS delayed logging: which commit is durable?. Hesela. 2026-11-30. https://hesela.com/analyses/xfs-delayed-logging-commit-boundaries/