xfs-deferred-operation · shipping · also XFS deferred work

XFS deferred operation

An XFS deferred operation postpones metadata work to a later transaction to satisfy locking or reservation constraints.

A chain of rolling transactions is not atomic in the journal, since recovery replays only up to the last committed member of the chain. An operation that needs several transactions therefore logs intent items, so that recovery can finish it once the first transaction is on disk. This is distinct from delayed logging's journal batching. [1]

Each roll logs an intent item for every pending work item, and a done item is logged as soon as the work completes. If a finishing step runs short of reservation, it logs a done item for the finished part and a new intent for the rest in the same transaction, then rolls and continues. A reference-count update on an n-block extent can change as many as n records, which is why such work is split. [2]

The v6.16 source declares ten deferred operation types, covering block mapping, reference counts, reverse mappings, extent freeing, extended attributes and mapping exchange, including real-time variants. Up to 5 inodes and 2 buffers can be held across a roll, and the inode limit comes from rename with parent pointers. [4]

The source comment's remapping example spans six transactions, t0 to t5. A crash before t2 commits makes recovery replay five logged intents and then generate three more for the work they lead to. [2]

Relations

related
XFS rolling transaction, XFS intent log item, XFS delayed logging, XFS, XFS allocation group

Advantages

  • Work too large for one transaction reservation can still be completed by log recovery after a crash. [1, 2]

Limitations

  • Inodes stay locked across the whole chain of rolling transactions, so nothing else can read or write them until it ends. [1]

Citations

  1. Linux v6.16: XFS Logging Design, introduction and transactions in XFS (accessed 2026-10-22)
  2. Linux v6.16: xfs_defer.c, deferred operations comment and remapping example (accessed 2026-10-22)
  3. Linux v6.16: xfs_defer.h, deferred operation types and resources held across a transaction roll (accessed 2026-10-22)

Further reading

  1. Hesela: XFS delayed logging and commit boundaries (accessed 2026-10-16)
Sources & caveats
  • design is the XFS Logging Design document in the Linux v6.16 tree, reread on the access date in the introduction and the transactions section.
  • defer-code is xfs_defer.c at v6.16, read in the header comment on deferred operations and its remapping example.
  • defer-header is xfs_defer.h at v6.16, read for the declared operation types and the held-resource limits.
  • Ten types, 5 inodes and 2 buffers come from defer-header. Six transactions, five replayed intents and three generated intents come from defer-code.

JSON: /data/terms/xfs-deferred-operation.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. XFS deferred operation. Hesela. 2026-11-30. https://hesela.dev/terms/xfs-deferred-operation/