freebsd-nq/sys/fs/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_clbio.c Rename vm_page_set_valid() to vm_page_set_valid_range(). 2011-11-30 17:39:00 +00:00
nfs_clcomsubs.c Fix the new NFS client so that it handles NFSv4 state 2011-05-27 22:05:10 +00:00
nfs_clkdtrace.c Add DTrace support to the new NFS client. This is essentially 2011-06-18 23:02:53 +00:00
nfs_clkrpc.c opt_inet6.h was missing from some files in the new NFS subsystem. 2012-01-08 01:54:46 +00:00
nfs_clnfsiod.c Change the sysctl naming for the old and new NFS clients 2011-05-15 20:52:43 +00:00
nfs_clnode.c Fix a LOR in the NFS client which could cause a deadlock. 2011-08-02 11:28:42 +00:00
nfs_clport.c opt_inet6.h was missing from some files in the new NFS subsystem. 2012-01-08 01:54:46 +00:00
nfs_clrpcops.c Close a race in NFS lookup processing that could result in stale name cache 2012-01-20 20:02:01 +00:00
nfs_clstate.c Post r223774, the NFSv4 client no longer has multiple instances 2011-12-03 02:27:26 +00:00
nfs_clsubs.c Simple find/replace of VOP_ISLOCKED -> NFSVOPISLOCKED. This is done so that NFSVOPISLOCKED can be modified later to add enhanced logging and assertions. 2011-07-16 08:05:41 +00:00
nfs_clvfsops.c Make sure all intermediate variables holding mount flags (mnt_flag) 2012-01-17 01:08:01 +00:00
nfs_clvnops.c Close a race in NFS lookup processing that could result in stale name cache 2012-01-20 20:02:01 +00:00
nfs_kdtrace.h Add DTrace support to the new NFS client. This is essentially 2011-06-18 23:02:53 +00:00
nfs.h Modify the experimental (newnfs) NFS client so that it uses the 2011-04-25 23:12:18 +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
nlminfo.h