Date: Fri, 20 Jan 2012 15:11:41 -0500 From: John Baldwin <jhb@freebsd.org> To: src-committers@freebsd.org Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r230394 - in head/sys: fs/nfsclient kern nfsclient sys Message-ID: <201201201511.41522.jhb@freebsd.org> In-Reply-To: <201201202002.q0KK21M6056471@svn.freebsd.org> References: <201201202002.q0KK21M6056471@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201201201511.41522.jhb>