Subject: Re: kern/25279: NFS read doesn't update atime
To: Manuel Bouyer <bouyer@antioche.lip6.fr>
From: Chuck Silvers <chuq@chuq.com>
List: tech-kern
Date: 07/08/2005 10:40:28
On Wed, Jul 06, 2005 at 03:42:27PM +0200, Manuel Bouyer wrote:
> On Mon, Jul 04, 2005 at 09:58:01AM -0700, Chuck Silvers wrote:
> > [...]
> > however, VOP_PUTPAGES() is used to write back dirty pages that were created
> > both via write() and via mappings, and we would like to avoid updating mtime
> > again when flushing dirty pages created by write(), since in that case there
> > is no question as to whether the mtime was updated in a coherent manner with
> > the file data.  while it would be possible to track exactly which pages are
> > dirtied via which mechanism, that would be rather messy.  most applications
> > modify file data via one interface or the other and don't flip back and forth,
> > so we'll usually do the right thing if we assume that.  currently we don't
> > know exactly when a vnode has mappings since we don't keep a count of them,
> > but we can approximate this by setting a flag in the vnode when a mapping is
> > created, and clearing this flag in VOP_INACTIVE().  in VOP_PUTPAGES(), we
> > would update mtime only if this flag is set.  I think that would give us
> > the desired behaviour in the vast majority of cases.
> 
> 
> I'm not sure I see all the details you're talking about here. Would you have
> some time to implement this ? Otherwise, do you think the last patch I posted
> (which updates the mtime in GOP_WRITE) could be commited as a?temporary
> measure ?

I have time, but due to health problems flaring up again recently
I should really to keep my typing to a minimum for a while.
I'd much rather someone else do it.

your most recent patch causes write() to update the mtime twice, once
at the correct point and then at another incorrect point up to 30 seconds
later.  that doesn't seem like a good fix, even temporarily.

-Chuck