I know XFS does not sync metadata even though the file being written is open with O_DIRECT
and the metadata of the file is changed. But for ext4, I notice that MySQL support O_DIRECT_NO_FSYNC
which means MySQL does not call fsync()
and lets the filesystem sync metadata by itself.
So here comes the question: if I open
a file with O_DIRECT
in ext4 (say linux kernel version 5.8.0), and call fsync()
after write()
, what will fsync()
do?
Another question to follow: what will fsync()
do if open()
a file with O_DIRECT | O_SYNC
in ext4?
Thanks!