Subject: Re: kern/25279: NFS read doesn't update atime
To: Manuel Bouyer <bouyer@antioche.lip6.fr>
From: Steven M. Bellovin <smb@cs.columbia.edu>
List: tech-kern
Date: 07/06/2005 10:59:08
In message <20050706145037.GA23369@antioche.lip6.fr>, Manuel Bouyer writes:
>On Wed, Jul 06, 2005 at 09:42:43AM -0400, Steven M. Bellovin wrote:
>> >> as modifications are visible to the world at this point,
>> >> "if (error == 0)" here doesn't make much sense.
>> >
>> >If genfs_gop_write() returned an error, it's possible that the data have no
>t
>> >been written, right ? Do we still want to update the mtime of the inode if
>> >no data was written on disk ?
>> >
>> 
>> Yes, because the write operation may have partially succeeded.
>
>The question is, should the mtime be updated on a partial write operation ?
>Some data have changed, but it may not be complete.
>
That's precisely the question I was answering; my opinion is that mtime 
should indeed be updated.

I think of mtime as a cheap way to avoid something like storing SHA1 
hashes of every file on the system.  It should thus change any time a 
new hash value would result; partial writes would certainly qualify.  
(My definition raises the interesting question of whether or not 
rewriting the same data should cause mtime to be updated.  
Architecturally, I can leave with either answer; pragmatically, note my 
use of the word "cheap" -- checking for that situation is too 
expensive.)

		--Steven M. Bellovin, http://www.cs.columbia.edu/~smb