And yet again here we are
Posted Dec 31, 2010 14:08 UTC (Fri) by
man_ls (subscriber, #15091)
In reply to:
Not again by Nick
Parent article:
Ext4 filesystem hits Android, no need to fear data loss (ars technica)
What I want is not a durable file, but an atomic rename. Not an empty file, but either the old version or the new.
Apparently the atomic rename is too confusing, or I am not explaining the use case clearly. Think about atomic appends to files then. When you append some sectors atomically, you want either the old file without the new sectors or the file with the new sectors at the end. What XFS did (and I experienced first hand) was add some uninitialized sectors to the file, and afterwards write the new content to the sectors. This behavior is apparently allowed by POSIX, and yet extremely annoying to users, who moved to other filesystems in droves.
An atomic append would guarantee that the new sectors would either be present with the expected contents or not present at all, but never contain random garbage. We don't need an fsync after every sector, nor would it solve the problem: after the write but before the fsync the filesystem would be in an incoherent state anyway, albeit for a short time.
(
Log in to post comments)