News for hackers. Stuff that matters.
Re:POSIX v. reality: A position on O_PONIES by rcxdude on Friday November 24, 2023 @02:24PM (#38407240)
Specifically (to hopefully clarify your point), the operation we wish to be atomic is 'replacing the mapping path A->data X with path A->data Y'. This is hoped to be done by placing data Y in path B (which does not need to be atomic )and then using the atomicity of the rename to move around the path. This then puts an ordering constraint that any observer (whether after a crash and looking at the written filesystem, or during the normal operation of the system) sees data Y going into path B before the rename B to A, and this is what POSIX does not guarantee.
Re:POSIX v. reality: A position on O_PONIES by throwaway09223 on Friday November 24, 2023 @02:48PM (#38407486)
Yeah, I get it. The issue is that filesystems don't work like you've assumed. I outlined why this idea cannot work here: https://news.ycombinator.com/item?id=38407472

Again, manipulating links has nothing to do with file data.

Re:POSIX v. reality: A position on O_PONIES by rcxdude on Saturday November 25, 2023 @03:55AM (#38412255)
It blatently can work, it's just not guaranteed by the standard (at least without an fsync). I don't think anyone is talking about situations where B is being actively written to while the rename happens.
Re:POSIX v. reality: A position on O_PONIES by throwaway09223 on Saturday November 25, 2023 @10:21AM (#38414040)
This is like saying sync() works.

You can sync to durable storage at any point, yes. But you cannot do it in a semantically useful fashion.

"I don't think anyone is talking about situations where B is being actively written to while the rename happens."

Well, you specifically are ignoring this. I'm not.

Filesystems are free to generate extra syncs whenever they like. You could even have a filesystem sync every single write operation to durable storage - why not?