Ext4 orphan file
An ext4 orphan file is an internal metadata file that stores inode-number slots for orphan cleanup when the orphan_file filesystem feature is enabled.
The legacy orphan list starts at s_last_orphan and uses each inode's i_dtime field as a next-inode link. The orphan file instead uses the special inode referenced by s_orphan_file_inum; a zero slot is unused. RO_COMPAT_ORPHAN_PRESENT indicates that entries may require recovery, not that an orphan definitely exists. It is set during writable use and cleared on clean unmount. [1] Unlike COMPAT_ORPHAN_FILE, an unknown RO_COMPAT_ORPHAN_PRESENT bit prevents an older kernel from mounting read-write; clearing it removes this barrier, not restrictions from other features or older checking tools. [3] Linux v6.12 falls back to the legacy list when orphan-file insertion returns ENOSPC. Here ENOSPC can mean no available orphan-file slots or a bounded slot search giving up, not necessarily filesystem-wide space exhaustion. This insertion path does not dynamically grow the preallocated orphan file, and fallback does not itself establish a user-visible operation failure. [2] See the paired recovery analysis. [6]
Relations
- related
- ext4-orphan-inode, inode, unlink
Limitations
- The feature changes recovery bookkeeping, not unlink semantics or application synchronization requirements. [1, 4, 5]