nfs-lookup-cache · shipping · also NFS name cache, NFS dentry cache

NFS lookup cache

An NFS lookup cache retains directory-name resolution results, including found and missing entries, subject to revalidation.

Related Observatory article: Read on hesela.com

Linux lookupcache=positive revalidates negative entries; lookupcache=none revalidates both positive and negative entries before use. These controls do not disable file-data caching. More validation can increase server work. [1]

The Linux client drops all cached LOOKUP results for a directory when it sees that directory's mtime change. Because the mtime is itself a cached attribute, detection waits for the directory attribute cache, which by default lasts between 30 and 60 seconds. Negative results have been cached since kernel 2.6.28, and earlier clients tracked only positive results. [1]

NFSv4 bounds how long a name cache entry may be used without checking the directory. Directory-changing operations return change_info4, a flag plus 64-bit change values from before and after the operation. A client may update its name cache only when the server reports them atomically and the before value matches its cached one, otherwise it purges that directory's cache. [2]

Relations

related
NFS change attribute, NFS, NFS attribute cache, Close-to-open consistency, NFS READDIR cookie

Advantages

  • Applications that do not share directories with other clients avoid repeated LOOKUP round trips. [1]

Limitations

  • Name visibility is not evidence of durable file contents or a multi-file transaction. [2, 3]
  • Applications on several clients that must notice file creation or removal quickly can see stale entries until the next revalidation. [1]

Citations

  1. nfs-utils nfs(5), Debian trixie: lookupcache option. (accessed 2026-10-22)
  2. RFC 7530, section 10.8: Name Caching. (accessed 2026-10-22)
  3. NFS stable writes: what COMMIT, flush and FUA actually promise (accessed 2026-10-14)
Sources & caveats
  • nfs-client is the nfs(5) manual page from nfs-utils in Debian trixie, read on the access date in the lookupcache, acdirmin and acdirmax options and Directory entry caching.
  • rfc7530 is RFC 7530 (NFSv4.0), read in section 10.8 and the change_info4 data type.
  • 30 and 60 seconds and 2.6.28 come from nfs-client. 64-bit comes from rfc7530 (changeid4 is uint64_t).

JSON: /data/terms/nfs-lookup-cache.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. NFS lookup cache. Hesela. 2026-10-22. https://hesela.dev/terms/nfs-lookup-cache/