On 20 February 2018 at 20:46, Christoph Hellwig <h...@infradead.org> wrote: > On Tue, Feb 20, 2018 at 12:22:01AM +0100, Andreas Gruenbacher wrote: >> When fsyncing a new file, also fsync the directory the files is in, >> recursively. This is how Linux filesystems should behave nowadays, >> even if not mandated by POSIX. > > I think that is bullshit. Maybe it is what google wants for ext4 > non-journal mode which no one else uses anyway. but it certainly > is anything but normal Linux semantics.
Here's some code from xfstest generic/322: _mount_flakey $XFS_IO_PROG -f -c "pwrite 0 1M" -c "fsync" $SCRATCH_MNT/foo \ > $seqres.full 2>&1 || _fail "xfs_io failed" mv $SCRATCH_MNT/foo $SCRATCH_MNT/bar $XFS_IO_PROG -c "fsync" $SCRATCH_MNT/bar md5sum $SCRATCH_MNT/bar | _filter_scratch _flakey_drop_and_remount md5sum $SCRATCH_MNT/bar | _filter_scratch _unmount_flakey Note that there is no fsync for the parent directory ($SCRATCH_MNT), yet the test obviously expects the directory to be synced as well. This isn't implemented as in this patch on all filesystems, but the major ones all show this behavior. So where's the bullshit? Thanks, Andreas