> Adhering to POSIX is not the same as being "perfectly good".
I love it how you think that your or my opinion actually matters here. What matters is what's been written in the documentation for years now. That is the _only_ objective thing programmers on both ends of this can rely on.
> No, it's perfectly synchronous, ordered, and atomic with respect to a running system.
Yeah, confuse the issue some more, when you don't have anything new to add.
We are discussing here the "ordering of writes to disk on rename". In respect to this, POSIX is asynchronous and unordered. Heck, you cannot even tell if two consecutive writes will be written in that order to disk.
> My behavior, your behavior, and overwriting with carrots are all perfectly POSIX-compliant with respect to a system that's been shut down uncleanly.
Your behaviour is truly what you would like it to be. What you are describing as my behaviour is what the documentation actually says, so it's not mine at all.
As or carrots, that is wrong, because you never fsynced carrots to disk, so they should not be there. But sure - implement it ;-)
> To the greatest extent possible, the state of a system after an unclean shutdown should reflect the state the system was in shortly before that shutdown, and an ordered rename goes a long way toward achieving that.
And also encourages application writers to keep writing broken code, file system writers to put hacks into the system to work around that broken code etc.