> However, the ordering effect of rename() turns out to be a file system specific implementation side effect. It only works when changes to the file data in the file system are ordered with respect to changes in the file system metadata. In ext3/4 [...]
Seems pretty clear to me that this is talking about an ext3/4 implementation detail that people have started to rely on...? I also pretty clearly remember that from back in 2009.
> This article is just plain wrong.
Articles like this helped me understand the distinction between theoretical POSIX semantics and what Linux was actually doing at the time.
It seems like you are reading more into this article than at least I got out of it – maybe it's because I still remember that 2009 controversy, but I wouldn't have drawn any of the (incorrect, and I agree on that!) conclusions you're listing above.
* ext4 turns rename() into an invisible fsync(), if the target file existed.
* ext4 turns close() into an invisible fsync(), if the opened file existed.
This leads to surprising results:
If you unzip something the first time, it's nice and fast.
If you unzip the same file again, force-overwriting existing files, suddenly it's 10x slower. You now spend hours finding out why, and start cargo-culting vodoo that doing `rm` before makes it inexplicably fast again.
Invisible fsync()s that the application programmer cannot turn off are quite bad.
My speculation is that Ted Ts'o agrees with that in principle, but that he got tired of having to explain people that if they don't fsync(), there are no guarantees; so he added this hack that makes 95% of the cases go away with surprising special-case behaviour.
* `auto_da_alloc` section of https://www.kernel.org/doc/html/latest/admin-guide/ext4.html
* https://en.wikipedia.org/wiki/Ext4#Delayed_allocation_and_po...
Then, gnome(?) and only gnome(?) relied on it, leading to massive filesystem corruption, so the kernel team gave up and made the old braindead behavior the default.
(The current default behavior is braindead because it makes rename extremely slow for correct programs that don’t care about durability across crashes, and therefore don’t call fsync).
I could write a filesystem that synchronized files after every 42 megabytes, or once every 69 seconds. Apps might even come to depend on this behavior. All filesystems will have predictable, implementation dependent idiosyncrasies.
But these aren't specified behaviors. They're not part of an interface and they shouldn't be depended on. The article implying that they ought to be is, I think, shortsighted. Other filesystems don't do this and your code will break if you assume it.
I agree it's braindead.
https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.g...
I don't think any other unix filesystems do this. It's not posix, and it's not behavior that any apps should be depending on if they care about their data.
I would suggest updating the LWN article to clarify that this is a piece specifically about ext4 -- not POSIX, or even Linux in general.