What is the meaning of the following statement from the fsync man page
Calling fsync() does not necessarily ensure that the entry in the directory containing the file has also reached disk. For that an explicit fsync() on a file descriptor for the directory is also needed.
Does it mean that fsync won't update the directory metadata when I call fsync on a file?
Another quote for the same problem is(from Robert Love's Book of Linux System Programming):
Neither function guarantees that any updated directory entries containing the file are synchronized to disk. This implies that if a file’s link has recently been updated, the file’s data may successfully reach the disk but not the associated directory entry, rendering the file unreachable.
Why would a file's data need to reach a directory link ? Correct me if I am wrong but the directories only contain the filename and the inode number for that file. The actual data is in the file. What is the meaning of "the data will reach the file but not the directory link"