From owner-svn-src-all@FreeBSD.ORG Fri Jan 20 20:11:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA1BF106566C; Fri, 20 Jan 2012 20:11:56 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id BCC338FC0A; Fri, 20 Jan 2012 20:11:56 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 6D70646B0C; Fri, 20 Jan 2012 15:11:56 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id E76A6B91C; Fri, 20 Jan 2012 15:11:55 -0500 (EST) From: John Baldwin To: src-committers@freebsd.org Date: Fri, 20 Jan 2012 15:11:41 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201201202002.q0KK21M6056471@svn.freebsd.org> In-Reply-To: <201201202002.q0KK21M6056471@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201201201511.41522.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 20 Jan 2012 15:11:56 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r230394 - in head/sys: fs/nfsclient kern nfsclient sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 20:11:57 -0000 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