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>