#filesystem

Exploring the Linux Kernel's iomap Layer

lwn.net · ⭐️ 8/10 · 2026-07-06

8/10

Jonathan Corbet published an in-depth article on LWN explaining the iomap layer in the Linux kernel, which handles mapping between filesystem space and storage space, introduced in kernel 4.8 by Christoph Hellwig. This article fills a knowledge gap about a core filesystem component, enabling kernel developers to better understand and use iomap for efficient I/O and reducing boilerplate code in filesystem implementations. The iomap structure uses a single struct to represent large extents, replacing the older buffer-head mechanism, and supports both block devices and DAX persistent memory. It consists of a low-level mapping layer and a higher-level operation layer.

At the 2026 Linux Storage, Filesystem, Memory Management, and BPF Summit, a session led by Miklos Szeredi discussed problems caused by excessive negative dentries in directories, including soft lockups, reference count overflow, and long hash chains. Negative dentries are a key optimization for filesystem lookups, but when a directory accumulates millions of them, they can cause severe performance issues and even security side-channel problems. The proposals discussed could lead to kernel patches that improve filesystem reliability and memory management. Proposed solutions include moving negative dentries to the end of the dchildren list so iterators can stop early, adding condresched() calls to avoid soft lockups, or switching to a more suitable data structure. Concerns were raised about ordering issues with getdents() and potential complications when a negative dentry becomes positive.