svn commit: r230394 - in head/sys: fs/nfsclient kern nfsclient
sys
John Baldwin
jhb at freebsd.org
Fri Jan 20 20:11:57 UTC 2012
On Friday, January 20, 2012 3:02:01 pm John Baldwin wrote:
> Author: jhb
> Date: Fri Jan 20 20:02:01 2012
> New Revision: 230394
> URL: http://svn.freebsd.org/changeset/base/230394
>
> Log:
> 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.
More details can be found in the thread on fs@ for the curious:
http://lists.freebsd.org/pipermail/freebsd-fs/2012-January/013442.html
--
John Baldwin
More information about the svn-src-all
mailing list