Comment by _urga
8 years ago
sync_file_range is different to fsync, fdatasync and O_DSYNC in that it does not flush the disk write cache (whereas the latter explicitly do on newer kernels):
https://linux.die.net/man/2/sync_file_range:
This system call does not flush disk write caches and thus does not
provide any data integrity on systems with volatile disk write caches.
Hence "sync_file_range combined with fdatasync". sfr is only useful to get the kernel to start the write-out now.