RESOLVE_CACHED
RESOLVE_CACHED is a Linux openat2 resolution flag requiring pathname lookup to complete using cached information.
Available since Linux 5.12, it returns EAGAIN when lookup cannot complete from cached information, for example when uncached revalidation or I/O is required. The flag concerns name lookup, not file-data residency or later read completion. [1]
For otherwise valid arguments, Linux v6.12 rejects O_CREAT, O_TRUNC or O_TMPFILE together with RESOLVE_CACHED before pathname lookup. An already existing, cached file does not exempt O_CREAT. Earlier argument checks still apply. [2]
A usable cached negative dentry can instead produce ENOENT. EAGAIN can also reflect a rooted-lookup race, so it is not a unique cache-miss diagnosis. A fallback may remove RESOLVE_CACHED while retaining containment, mount and symlink restrictions. [3] [1]
Relations
- related
- Path resolution, Dentry, Page cache, O_PATH, RWF_NOWAIT
Limitations
- Source-derived behavior, not a latency benchmark or a guarantee that the entire open operation or subsequent reads cannot block.
Citations
- Linux man-pages: openat2(2), RESOLVE_CACHED and EAGAIN error cases
- Linux v6.12: build_open_flags validation and do_sys_openat2 ordering
- Linux v6.12: step_into negative dentries and complete_walk
Sources & caveats
- Source review of Linux v6.12 and the Linux API manual; no successful native probe.
- Human explanation: https://hesela.com/analyses/atomic-rename-directory-durability/#resolve-cached
- Source-derived flag table and hashes: https://hesela.dev/research/resolve-cached/contracts.json