Occasionally, CRIU encounters an open file descriptor for which the kernel no longer maintains a path. This document explains how CRIU uses file handles and Inode Reverse Mapping (Irmap) to reconstruct these “nameless” files.
The most common scenario for path loss occurs with fsnotify (inotify and fanotify) instances.
When an application calls inotify_add_watch(path), the kernel:
The resulting file descriptor points to the fsnotify instance, which knows which inode it is watching but not where that inode lives in the filesystem hierarchy. Because the dentry (directory entry) cache can be shrunk by the kernel at any time, the path information is often permanently lost to userspace.
Linux provides a specialized system call, open_by_handle_at(), designed for userspace NFS servers. It allows opening a file using a File Handle—a filesystem-specific blob of bytes that uniquely identifies an inode.
/proc/$pid/fdinfo/$fd. (CRIU developers upstreamed patches to the Linux kernel to ensure this information is exposed).open_by_handle_at(). This returns an O_PATH file descriptor pointing to the original inode, even if its original path is unknown.O_PATH descriptor to re-establish the inotify or fanotify watch, effectively “tricking” the kernel into watching the correct inode.Not all filesystems support file handles (e.g., some older or specialized filesystems). In these cases, CRIU must resort to a brute-force approach called Irmap.
The Irmap engine maintains a cache that maps (device, inode) pairs back to their filesystem paths.
irmap-cache.img file and reused during the final dump./proc and do not require handles or Irmap.