Add vfs.nfs.pos_cache_timeout to complement vfs.nfs.neg_cache_timeout.
commit951c53d92646625a19e07da2eb216e6c8da8663b
authorMatthew Dillon <dillon@dragonflybsd.org>
Fri, 15 Jun 2007 17:25:05 +0000 (15 17:25 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Fri, 15 Jun 2007 17:25:05 +0000 (15 17:25 +0000)
treeba57ac54cd934fd996287d198ebcf32364544cfa
parentbc73bd8bf4bf3249fc34aca2460acbb14a47cee2
Add vfs.nfs.pos_cache_timeout to complement vfs.nfs.neg_cache_timeout.
Because NFSv3 is stateless, the client normally relies on the server
returning ESTALE (Stale NFS handle) to determine whether a relookup is
needed.  However, this does not cover namespace issues such as rename()s
and it is possible to get into a situation where a NFS client winds up
getting permanently out of sync with a server, requiring remounting to
fix.

The positive cache timeout will force open/stat and other namespace
operations to re-lookup the name, even if the file handle is still
valid.  The performance impact tested via a buildworld with a read-only
NFS mounted /usr/src appears to be minimal.

The positive cache timeout defaults to 3 second, same as the negative cache
timeout.  The timeout can be adjusted on the fly for any new namespace
lookups but changing the sysctl will not change any namespace lookups already
cached until they timeout.

Reported-by: Joerg Sonnenberger <joerg@britannica.bec.de>
sys/vfs/nfs/nfs_vnops.c