naguam I was wondering what is the behaviour of NetBSD.
From the fync(2) man-page:
Neither fsync() nor the default behavior of fsync_range() (with-
out the FDISKSYNC flag) will flush disk caches, because they assume that
storage devices are able to ensure that completed writes are transferred
to media some time between the write and a power failure or system crash.
A quick reading of the sources confirms this: No guarantee with fsync()
; fsync_range(FDISKSYNC)
on FFS does wait for an NVMe drive to complete queued ops. (Must check if this is done for HDDs...haven't done it yet.)