freebsd-nq/sys
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
..
amd64 Add definitions for the FPU extended state header, legacy extended 2012-01-17 17:07:13 +00:00
arm Add parentheses where required. Without them, `sizeof LDBL_MAX' 2012-01-20 06:51:41 +00:00
boot Wrap changes from svn r212126 inside LOADER_NFS_SUPPORT such that 2012-01-19 01:25:50 +00:00
bsm
cam Quiet some clang warnings when compiling CTL. 2012-01-19 18:42:03 +00:00
cddl Fix the "lock &zrl->zr_mtx already initialized" assertion by initializing 2012-01-17 06:23:25 +00:00
compat Make sure all intermediate variables holding mount flags (mnt_flag) 2012-01-17 01:08:01 +00:00
conf Add the .opd section, this is helps booting a profiled kernel. 2012-01-20 18:52:31 +00:00
contrib Allocate our mbuf with m_get2(). 2012-01-17 12:14:26 +00:00
crypto Update Copyright. 2011-10-27 14:15:26 +00:00
ddb Use strchr() and strrchr(). 2012-01-02 12:12:10 +00:00
dev Properly return success once a matching VPD entry is found in 2012-01-19 21:38:19 +00:00
fs Close a race in NFS lookup processing that could result in stale name cache 2012-01-20 20:02:01 +00:00
gdb kern cons: introduce infrastructure for console grabbing by kernel 2011-12-17 15:08:43 +00:00
geom Allow an MBR primary or extended Linux swap partition to be specified 2012-01-13 18:32:56 +00:00
gnu Make sure all intermediate variables holding mount flags (mnt_flag) 2012-01-17 01:08:01 +00:00
i386 Add definitions for the FPU extended state header, legacy extended 2012-01-17 17:07:13 +00:00
ia64 Add parentheses where required. Without them, `sizeof LDBL_MAX' 2012-01-20 06:51:41 +00:00
isa - There's no need to overwrite the default device method with the default 2011-11-22 21:28:20 +00:00
kern Close a race in NFS lookup processing that could result in stale name cache 2012-01-20 20:02:01 +00:00
kgssapi Add missing break statement to make sure all 3DES etypes really are treated 2011-10-10 09:13:07 +00:00
libkern Implement extensions on top of standards instead of the other way around. 2012-01-03 07:05:30 +00:00
mips Add parentheses where required. Without them, `sizeof LDBL_MAX' 2012-01-20 06:51:41 +00:00
modules Connect the bktr module(s) to the amd64 build. 2012-01-18 08:56:26 +00:00
net - Fix trivial typo 2012-01-14 17:07:52 +00:00
net80211 Fix the situation where net80211 is built with IEEE80211_SUPPORT_TDMA but a module 2012-01-15 19:45:23 +00:00
netatalk Convert all users of IF_ADDR_LOCK to use new locking macros that specify 2012-01-05 19:00:36 +00:00
netgraph The newhook method can be called in ISR context at 2012-01-17 18:10:25 +00:00
netinet Remove a superfluous INET6 check (no opt_inet6.h included anyway). 2012-01-20 17:18:54 +00:00
netinet6 Small cleanup, no functional change. 2012-01-15 14:03:05 +00:00
netipsec Remove unused 'plen' variable. 2011-11-26 23:57:03 +00:00
netipx Convert all users of IF_ADDR_LOCK to use new locking macros that specify 2012-01-05 19:00:36 +00:00
netnatm
netncp Change ncp_scan_bindery_object() to pass a constant search string. 2011-10-16 08:44:03 +00:00
netsmb Add unicode support to msdosfs and smbfs; original pathes from imura, 2011-11-18 03:05:20 +00:00
nfs Some cleanup of BOOTP code. Initially I wanted to just change the ifioctl() 2011-12-13 07:02:48 +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 Honor NFSv3 commit call (RFC 1813, Section 3.3.21) where when count is 0, 2011-12-15 02:26:53 +00:00
nlm Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs. 2011-11-07 15:43:11 +00:00
ofed Remove spurious 8bit chars, turning files into plain ASCII. 2012-01-15 13:23:54 +00:00
opencrypto
pc98 Flip these options on so the modules build correctly for now. 2012-01-06 08:51:20 +00:00
pci To save more power, switch to 10/100Mbps link when controller is 2011-11-23 23:29:18 +00:00
powerpc Add parentheses where required. Without them, `sizeof LDBL_MAX' 2012-01-20 06:51:41 +00:00
rpc Both a crash reported on freebsd-current on Oct. 18 under the 2011-11-03 14:38:03 +00:00
security Use strchr() and strrchr(). 2012-01-02 12:12:10 +00:00
sparc64 Add the CAM Target Layer (CTL). 2012-01-12 00:34:33 +00:00
sys Close a race in NFS lookup processing that could result in stale name cache 2012-01-20 20:02:01 +00:00
teken Link the demo application against ncursesw to make Unicode work. 2011-10-13 14:20:27 +00:00
tools Restore the comment that I removed by accident. 2011-11-09 13:26:59 +00:00
ufs There are several bugs/hangs when trying to take a snapshot on a UFS/FFS 2012-01-17 01:14:56 +00:00
vm Revert r212360 now that PowerPC can handle large sparse arguments to 2012-01-17 00:31:09 +00:00
x86 Fix a few bugs in the SRAT parsing code: 2012-01-03 20:53:58 +00:00
xdr
xen s/timout/timeout 2011-12-15 06:29:13 +00:00
Makefile Improve the cscope target's handling of MD directories. Automatically 2012-01-03 17:31:27 +00:00