What does it take to be durable on Linux?
问题 I'm writing some software to deal with pretty critical data, and need to know what exactly I need to do to achieve durability. Everywhere I look is contradictory information, so I'd appreciate any insight. There are three ways I write to disk. Using O_DIRECT | O_DSYNC, and pread'ing and then pwrite'ing 512 byte - 16 MB blocks. Using O_DIRECT, pread'ing and then pwrite'ing 512 byte blocks, and calling fdatasync as regularly as necessary. Using a memory mapped file, which I call msync(..., MS