freenode
Kernel & Low-Level

ext4 moves to drop inline data writes for regular files

An RFC series would deprecate the feature after years of bugs, syzbot hits, and at least eight CVEs, while keeping it for directories.

Yun Zhou has posted an RFC patch series to phase out inline data write paths for regular files in ext4, arguing the feature has become a steady source of kernel bugs for little practical gain.

Inline data lets tiny files store their contents inside the inode instead of a separate block. In theory that saves at most one 4K block per file. In practice almost no regular files are small enough to benefit, major distributions leave the feature off by default in mkfs.ext4, and the special-case code touches write, mmap, truncate, and locking paths that interact with several different locks. Zhou counts more than fifteen kernel fixes since mid-2023 (BUG_ONs, use-after-frees, out-of-bounds reads, races, and corruption), four e2fsprogs fixes, a handful of still-open syzbot reports, and at least eight CVEs, among them CVE-2023-52786, CVE-2024-42304, CVE-2025-38222, CVE-2025-38701, CVE-2025-40167, CVE-2025-68264, CVE-2026-31451, and CVE-2026-31452.

The series does not yank the on-disk feature. It emits a mount-time deprecation warning, stops creating new regular-file inodes with inline data, and makes any write or mmap of an existing inline regular file convert it atomically to ordinary block storage. Reads of still-inline files continue to work. Directory inline data is left alone because small directories still gain from it without the same write-path complexity. Conversion is reworked so the data block is allocated and written before the inline copy is destroyed, eliminating restore-on-failure paths that themselves could fail or race. Dead write-end and delayed-allocation convert helpers are removed, documentation is updated, and a narrow i_data_sem window during conversion is closed.

The net result, if accepted, is that filesystems that already use the feature keep working with transparent conversion on first modification, while the kernel sheds a long-standing source of subtle locking and state bugs.