From owner-svn-src-all@FreeBSD.ORG Sat Feb 21 08:47:51 2009 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 052941065675; Sat, 21 Feb 2009 08:47:51 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id D12768FC1C; Sat, 21 Feb 2009 08:47:50 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 1723A46B23; Sat, 21 Feb 2009 03:47:50 -0500 (EST) Date: Sat, 21 Feb 2009 08:47:50 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: John Baldwin In-Reply-To: <200902192210.n1JMAddn009074@svn.freebsd.org> Message-ID: References: <200902192210.n1JMAddn009074@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r188831 - head/sys/nfsclient 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: Sat, 21 Feb 2009 08:47:51 -0000 On Thu, 19 Feb 2009, John Baldwin wrote: > Author: jhb > Date: Thu Feb 19 22:10:39 2009 > New Revision: 188831 > URL: http://svn.freebsd.org/changeset/base/188831 > > Log: > Don't clear the attribute cache of a file when it is closed. A subsequent > open() of the same file will load fresh attributes, so they do not need to > be explicitly flushed in close() to guarantee close to open consistency. > However, other file desciptors may still reference this file and clearing > the attributes in close() forces those other file descriptors to fetch > fresh attributes the next time they need them. (hand wave) Not an area of expertise for me, but I was under the loose impression that one of the reasons for this refresh was to pull in new timestamps, etc so that applications using file attributes to track modification time, size, etc definitely saw the right thing reflecting the server interpretation of all the pending writes having been flushed back on close(). (more hand waving) Robert N M Watson Computer Laboratory University of Cambridge > > Reviewed by: mohans > MFC after: 1 week > > Modified: > head/sys/nfsclient/nfs_vnops.c > > Modified: head/sys/nfsclient/nfs_vnops.c > ============================================================================== > --- head/sys/nfsclient/nfs_vnops.c Thu Feb 19 21:29:30 2009 (r188830) > +++ head/sys/nfsclient/nfs_vnops.c Thu Feb 19 22:10:39 2009 (r188831) > @@ -594,13 +594,6 @@ nfs_close(struct vop_close_args *ap) > error = nfs_vinvalbuf(vp, V_SAVE, ap->a_td, 1); > mtx_lock(&np->n_mtx); > } > - /* > - * Invalidate the attribute cache in all cases. > - * An open is going to fetch fresh attrs any way, other procs > - * on this node that have file open will be forced to do an > - * otw attr fetch, but this is safe. > - */ > - np->n_attrstamp = 0; > if (np->n_flag & NWRITEERR) { > np->n_flag &= ~NWRITEERR; > error = np->n_error; >