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 09:42:43
In message <20050706133255.GA23097@antioche.lip6.fr>, Manuel Bouyer writes:
>On Thu, Jun 30, 2005 at 12:13:31PM +0900, YAMAMOTO Takashi wrote:
>> > +int
>> > +ufs_gop_write(struct vnode *vp, struct vm_page **pgs, int npages, int fla
>gs)
>> > +{
>> > +	struct inode *ip = VTOI(vp);
>> > +	int error;
>> > +
>> > +	error = genfs_gop_write(vp, pgs, npages, flags);
>> > +	if (error == 0) {
>> > +		/* file has been written, update mtime */
>> > +		ip->i_flag |= IN_CHANGE | IN_UPDATE;
>> > +	}
>> > +	return error;
>> > +}
>> 
>> 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 not
>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.

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