svn commit: r188831 - head/sys/nfsclient
John Baldwin
jhb at freebsd.org
Mon Feb 23 07:34:21 PST 2009
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
More information about the svn-src-head
mailing list