bug with fsync ?
Tony Luck
aegl at root44.UUCP
Thu Feb 21 04:59:28 AEST 1985
A couple of days ago while perusing a backup tape (made with /etc/dump)
I was surprised to find several files that I was sure shouldn't have been
changed recently. Checking with 'ls' showed that they hadn't been modified
-but the inode modified time had been updated very recently. I remembered
having 'vi'ed the file - but not as superuser i.e. without any write access.
Further investigation showed that 'vi' would reset the st_ctime field of
any file - regardless of write permission or desire (even when invoked as
view). The cause is an 'fsync' call. Many questions remain:
1) Why does dump backup files based on the st_ctime field?
2) Why does the the st_ctime field on a file get updated when
you use 'fsync' on a file descriptor open only for reading?
3) Why does vi 'fsync' files anyway?
Any theories on any of the above topics would be greatly appreciated
before I wade in and hack the offending programs to shreds.
unisoft!root44!rootcl!aegl
mcvax!ukc!root44!aegl
More information about the Comp.bugs.4bsd.ucb-fixes
mailing list