On some filesystems, when creating a file, it is necessary to call fsync() not only on the file itself, but also on the parent directory, to make the file creation durable. Otherwise, the directory entry could get lost on an unclean unmount; the file inode would be orphaned.
Is that still true for ext4, or does the jornal take care of that?
Many applications (e.g. vim, as verified by strace) seem to call fsync on the file only. Is that safe?
Update: In commit 14ece1028b3ed53ffec1b1213ffc6acaf79ad77c to the kernel, ext4 is changed specifically so that, with disabled journaling, the parent directory entry is automatically fsync()ed when fsync()ing the file itself. But what about enabled journaling? Is the directory fsync() implicit, since it is part of the same transaction as the creation of the new inode?