set last write time = fsync ?

Steve French smfrench at gmail.com
Thu Mar 13 03:52:42 GMT 2008


kukks noticed that "cp -p source-file /cifs-mnt" would not set the
last write time to the previous time

It looks like a straightforward caching sideffect - "cp -p" does

open
write
set time stamps (utimensat)
set uid/gid (fchown32)
set acl (setxattr(system.posix_acl_access))
close

but the write is cached until close (which does a flush just before
the close) - so the final write resets the time which was set
correctly earlier

Should we add logic to cache the set of the time stamps too (at least
when there is write behind cache data)?  This would also allow us to
avoid setting the timestamp in some cases in which a write happened
after the setattr of the timestamp.

I don't really want to get to the point where utimes ==> fsync  that
seems way overdone


-- 
Thanks,

Steve


More information about the samba-technical mailing list