Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Feb 2009 10:02:58 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        Robert Watson <rwatson@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r188831 - head/sys/nfsclient
Message-ID:  <200902231002.59036.jhb@freebsd.org>
In-Reply-To: <alpine.BSF.2.00.0902210845440.98609@fledge.watson.org>
References:  <200902192210.n1JMAddn009074@svn.freebsd.org> <alpine.BSF.2.00.0902210845440.98609@fledge.watson.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Saturday 21 February 2009 3:47:50 am Robert Watson wrote:
> 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)

I believe that a client always sees updates it performs, so it will always see 
any updates that result from a write() call that happens before the close().  
The only attribute updates that would not now be seen in between a close() 
and open() are updates made by another client.  However, this is "normal" for 
NFS and matches what happens while a file is opened.  What close-to-open 
requires is that the client have "fresh" attributes when open() is called.  
It does not make any guarantees about attributes after a close() and before 
an open().

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200902231002.59036.jhb>