XFS intent log item
An XFS intent log item describes deferred work that log recovery may need to complete.
A matching done item suppresses replay of that intent. A continuation records done plus a replacement intent in the same transaction, so done need not end the logical operation. [1] Neither record alone acknowledges application durability. [3]
A long operation split over several transactions is not atomic as a chain, and recovery replays only up to the last committed transaction. Intents let recovery finish such an operation once its first transaction reaches the on-disk journal. [4]
Linux v6.16 defines nine intent item types, each paired with a done item, such as the extent free intent 0x1236 and its done item 0x1237. The others cover reverse mapping, reference count, block mapping, extended attribute and mapping exchange updates, plus realtime variants of extent free, reverse mapping and reference count. [5]
While deferred work is finished, a chain can keep up to five inodes and two buffers joined across transaction rolls. [6]
Relations
Advantages
- Each intent type has its own log item code, so recovery can pair intents with done items by type. [5]
Limitations
- How much of a long operation reached the journal before a crash cannot be predicted, only that recovery can finish it. [4]
Citations
- Linux v6.16: xfs_defer.c, deferred operations and atomic intent continuation
- Hesela: XFS delayed logging and commit boundaries
- Linux v6.16 XFS Delayed Logging Design: logging concepts and permanent transactions
- Linux v6.16 fs/xfs/libxfs/xfs_log_format.h: log item types
- Linux v6.16 fs/xfs/libxfs/xfs_defer.h: deferred operation resource limits
Further reading
Sources & caveats
- dld is the Linux v6.16 XFS delayed logging design document, read on the access date in its introduction and the section on permanent transactions.
- format-header is fs/xfs/libxfs/xfs_log_format.h at tag v6.16, read in the XFS_LI_* log item type definitions.
- defer-header is fs/xfs/libxfs/xfs_defer.h at tag v6.16, read for XFS_DEFER_OPS_NR_INODES and XFS_DEFER_OPS_NR_BUFS.
- Nine, 0x1236 and 0x1237 come from format-header. Five and two come from defer-header.