freebsd-skq/sys/fs
jhb f75e35e4d7 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
..
cd9660 Make sure all intermediate variables holding mount flags (mnt_flag) 2012-01-17 01:08:01 +00:00
coda Second-to-last commit implementing Capsicum capabilities in the FreeBSD 2011-08-11 12:30:23 +00:00
deadfs Add function vop_rename_fail(9) that performs needed cleanup for locks 2010-04-02 14:03:01 +00:00
devfs Explicitly use curthread while manipulating td_fpop during last close 2011-12-09 17:49:34 +00:00
ext2fs Migrate ufs and ext2fs from skpc() to memcchr(). 2012-01-01 20:47:33 +00:00
fdescfs Make sure all intermediate variables holding mount flags (mnt_flag) 2012-01-17 01:08:01 +00:00
fifofs Initialize fifoinfo fi_wgen field on open. The only important is the 2011-12-04 19:25:49 +00:00
hpfs Make sure all intermediate variables holding mount flags (mnt_flag) 2012-01-17 01:08:01 +00:00
msdosfs Make sure all intermediate variables holding mount flags (mnt_flag) 2012-01-17 01:08:01 +00:00
nfs Martin Cracauer reported a problem to freebsd-current@ under the 2012-01-20 00:58:51 +00:00
nfsclient Close a race in NFS lookup processing that could result in stale name cache 2012-01-20 20:02:01 +00:00
nfsserver Tai Horgan reported via email that there were two places in 2012-01-14 04:04:58 +00:00
ntfs Make sure all intermediate variables holding mount flags (mnt_flag) 2012-01-17 01:08:01 +00:00
nullfs Subject: NULLFS: properly destroy node hash 2012-01-18 11:23:46 +00:00
nwfs Make sure all intermediate variables holding mount flags (mnt_flag) 2012-01-17 01:08:01 +00:00
portalfs Make sure all intermediate variables holding mount flags (mnt_flag) 2012-01-17 01:08:01 +00:00
procfs Abrogate nchr argument in proc_getargv() and proc_getenvv(): we always want 2012-01-15 18:47:24 +00:00
pseudofs Make sure all intermediate variables holding mount flags (mnt_flag) 2012-01-17 01:08:01 +00:00
smbfs Make sure all intermediate variables holding mount flags (mnt_flag) 2012-01-17 01:08:01 +00:00
tmpfs Return EOPNOTSUPP since we only support update mounts for NFS export. 2012-01-17 01:25:53 +00:00
udf Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs. 2011-11-07 06:44:47 +00:00
unionfs Make unionfs also clear VAPPEND when clearing VWRITE, since VAPPEND 2011-10-10 21:32:08 +00:00