Ext4 filesystem hits Android, no need to fear data loss (ars technica)
Posted Jan 1, 2011 18:54 UTC (Sat) by
butlerm (subscriber, #13312)
In reply to:
Ext4 filesystem hits Android, no need to fear data loss (ars technica) by neilbrown
Parent article:
Ext4 filesystem hits Android, no need to fear data loss (ars technica)
If you really wanted to export journalling-style protection to user-space apps, I would look at allowing dependencies to be specified, either implicitly (close -> rename) or explicitly.
User specified dependencies are completely unnecessary. All that is necessary is for filesystems to exercise a little bit of additional effort to preserve POSIX semantics across system crashes. That means atomic renames, among other things.
Very simple: log the rename in the journal. Keep the old inode around until the data associated with the replacement inode commits to disk. If the system crashes in the meantime, on recovery undo the rename, thereby restoring the association between the name and the old inode.
No need to commit the new inode data implicitly or explicitly prior to writing any metadata journal entries. No need to call fsync unless you actually want synchronous behavior. No need to start writeout on the new inode immediately, either.
(
Log in to post comments)