Comment by saagarjha

7 years ago

I didn't read the entire thread, so maybe this was answered: has anyone actually made a system that's "fully" correct with regards to file system errors? Most people throw them away, but even programs that try to account for them get them wrong on some system (or the system changes behavior from out under them…). Is there a library that does this?

FreeBSD gets the kernel side correct (dirty unwritable blocks continue to report IO errors, including to fsync()) so you can at least build reliable libraries and applications on top of it.

Sqlite has put immense effort into this—it’s a better fopen!

That said, my understanding is that handling this with cross-platform, posix-only code is mostly impossible due to behavior like what’s described in the article.

Solaris, from which came OpenSolaris, which was forked into illumos, from which SmartOS is built.

fsync(2) there does exactly what POSIX says: it will only return success if the write safely made it to disk.

This is the #1 reason why all my infrastructure runs on a combination of Solaris and SmartOS and the primary reason why I don't run GNU/Linux on anything that's mine. #2 reason is that Solaris / illumos and therefore SmartOS will not overcommit memory, whereas in GNU/Linux this must be explicitly disabled, since overcommit is enabled by default.