4 ms·
> Well, at least in this case one can abort (or go into some read-only mode) in case of fsync() returning failure. the problem here isn’t if fsync() returns fa
by techslave 7y ago
> Well, at least in this case one can abort (or go into some read-only mode) in case of fsync() returning failure.
the problem here isn’t if fsync() returns failure. it’s that it always returns success, even if it failed.
- masklinn 7y ago> it’s that it always returns success, even if it failed. It doesn't (except on the most broken of old Linux kernels, and even then it mostly lost async write errors). Rather it's that on most systems (basically all of them except FreeBSD and Illumos, possibly OpenBSD after some recent changes) fsync will only report errors once, but that call will clear the flags and subsequent fsync calls will succeed (unless new errors have occurred). Basically, you can only rely on fsync reporting errors having happened since the last fsync, which is obviously concerning for all sort of reasons (not least being concurrent updates). They also mention a bit about fsync not necessarily reporting errors from before the file was opened.