This code was skipping fsync on BTRFS because of an old guarantee about the overwrite-by-rename behavior that no longer holds true. This has been confirmed by the BTRFS developers to no longer be guaranteed since Kernel 3.17 (August 2014), but it was guaranteed when this optimization was first introduced in 2010.
This could result in empty files after crashes in applications using g_file_set_contents(). Most prominently this might have been the cause of dconf settings getting lost on BTRFS after crashes due to the frequency with which such writes can happen in dconf.
See: dconf#73 (closed)
Trivial backport of !2425 (merged) to