Rename doesn't sync

From PortaWiki

Jump to: navigation, search

Rename doesn't sync

Nowhere in POSIX spec does it say that rename implies sync. It just so happens that ext3 in its default mode will write metadata before data, which may give you this illusion.

The following is not a "safe save": open(a.bak) write(a.bak) close(a.bak) rename(a.bak,a)

There may be data blocks in a.bak that have not yet been written to disk when the rename hits disk.

Personal tools