]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/commit
MFC 230394,230441,230489,230552,232420:
authorjhb <jhb@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 21 Mar 2012 20:50:47 +0000 (20:50 +0000)
committerjhb <jhb@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 21 Mar 2012 20:50:47 +0000 (20:50 +0000)
commit6db72f9b20a23cd9ba62df3a1d40d321940bf974
treed21645a5cf3201200ca7e6bd21aecae569052b5d
parentf14a3ee3fdbb3c9654326124c127409fba665d27
MFC 230394,230441,230489,230552,232420:
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.

git-svn-id: svn://svn.freebsd.org/base/stable/8@233286 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/fs/nfsclient/nfs_clrpcops.c
sys/fs/nfsclient/nfs_clvnops.c
sys/fs/nfsclient/nfsnode.h
sys/kern/vfs_cache.c
sys/nfsclient/nfs_subs.c
sys/nfsclient/nfs_vnops.c
sys/nfsclient/nfsm_subs.h
sys/nfsclient/nfsnode.h
sys/sys/vnode.h