Comment by ryao

4 years ago

The POSIX specification requires data to be on stable storage following fsync. Anything less is broken behavior.

An fsync that does not require the completion of an IO barrier before returning is inherently broken. This would be REQ_PREFLUSH inside Linux.

> If _POSIX_SYNCHRONIZED_IO is not defined, the wording relies heavily on the conformance document to tell the user what can be expected from the system.

> fsync() might or might not actually cause data to be written where it is safe from a power failure.