News for hackers. Stuff that matters.
Re:POSIX v. reality: A position on O_PONIES by dale_glass on Thursday November 23, 2023 @06:12PM (#38398806)
The trick is not allowing such a thing. Don't have something vague like "fsync_that_works" that could be implemented arbitrarily.

Have a function that is documented to implement a highly specific contract, like "writes all pending blocks of this file to disk, and ensures they'll be there if there's a crash after the function returns".

Re:POSIX v. reality: A position on O_PONIES by fl0ki on Thursday November 23, 2023 @06:37PM (#38399010)
That's exactly what people expect from fsync(). The problem explained in the article is that, due to the difficulties of tracing every possible related write, it is (was?) often implemented conservatively and waited for more writes to land than were strictly necessary.

I don't know how much this tracing has improved in various kernels since 2009, but I do know that I would want them to benefit fsync(), not to make a new function with a subtly different contract.