ext4 and data loss
Posted Mar 14, 2009 1:58 UTC (Sat) by
quotemstr (subscriber, #45331)
In reply to:
ext4 and data loss by bojan
Parent article:
ext4 and data loss
Just because something worked one way in one mode of one file system...
There's plenty of precedent. The original Unix filesystem worked that way. UFS works that way with soft-updates. ZFS works that way. There are plenty of decent filesystems that will provide atomic replace with
rename.
...you get it on ext4, even without Ted's most recent patches (i.e. you get the empty file).
Not from the perspective of the whole operation you don't. You set out trying to replace the contents of the file called /foo/bar, atomically. If /foo/bar ends up being a zero-length file, the intended operation wasn't atomic. That's like saying you don't need any synchronization for a linked list because the individual pointer modifications are atomic. Atomic replacement of a file without forcing an immediate disk sync
is something a decent filesystem should provide. Creating a write barrier on
rename is an elegant way to do that.
(
Log in to post comments)