freebsd-dev/sys/nfsclient
John Baldwin 5aefb4cbbf Close a race in NFS lookup processing that could result in stale name cache
entries on one client when a directory was renamed on another client.  The
root cause for the stale entry being trusted is that each per-vnode nfsnode
structure has a single 'n_ctime' timestamp used to validate positive name
cache entries.  However, if there are multiple entries for a single vnode,
they all share a single timestamp.  To fix this, extend the name cache
to allow filesystems to optionally store a timestamp value in each name
cache entry.  The NFS clients now fetch the timestamp associated with
each name cache entry and use that to validate cache hits instead of the
timestamps previously stored in the nfsnode.  Another part of the fix is
that the NFS clients now use timestamps from the post-op attributes of
RPCs when adding name cache entries rather than pulling the timestamps out
of the file's attribute cache.  The latter is subject to races with other
lookups updating the attribute cache concurrently.  Some more details:
- Add a variant of nfsm_postop_attr() to the old NFS client that can return
  a vattr structure with a copy of the post-op attributes.
- Handle lookups of "." as a special case in the NFS clients since the name
  cache does not store name cache entries for ".", so we cannot get a
  useful timestamp.  It didn't really make much sense to recheck the
  attributes on the the directory to validate the namecache hit for "."
  anyway.
- ABI compat shims for the name cache routines are present in this commit
  so that it is safe to MFC.

MFC after:	2 weeks
2012-01-20 20:02:01 +00:00
..
nfs_bio.c Rename vm_page_set_valid() to vm_page_set_valid_range(). 2011-11-30 17:39:00 +00:00
nfs_kdtrace.c Fix the module dependency in nfs_kdtrace.c for the old NFS 2011-05-06 19:55:15 +00:00
nfs_krpc.c jwd@ reported a problem via email where the old NFS client would 2011-12-21 02:45:51 +00:00
nfs_nfsiod.c Change the sysctl naming for the old and new NFS clients 2011-05-15 20:52:43 +00:00
nfs_node.c Fix a LOR in the NFS client which could cause a deadlock. 2011-08-02 11:24:42 +00:00
nfs_subs.c Close a race in NFS lookup processing that could result in stale name cache 2012-01-20 20:02:01 +00:00
nfs_vfsops.c Make sure all intermediate variables holding mount flags (mnt_flag) 2012-01-17 01:08:01 +00:00
nfs_vnops.c Close a race in NFS lookup processing that could result in stale name cache 2012-01-20 20:02:01 +00:00
nfs.h Fix a comment that got missed by r221973 which changed 2011-05-16 13:12:09 +00:00
nfsargs.h Implemented a mount option "nocto" that disables cache coherency 2011-05-04 13:27:45 +00:00
nfsm_subs.h Close a race in NFS lookup processing that could result in stale name cache 2012-01-20 20:02:01 +00:00
nfsmount.h Fix the nlm so that it no longer depends on the regular 2011-01-03 20:37:31 +00:00
nfsnode.h Close a race in NFS lookup processing that could result in stale name cache 2012-01-20 20:02:01 +00:00
nfsstats.h
nlminfo.h - Fix leak of struct nlminfo on process exit. 2005-10-26 07:18:37 +00:00