does fsync(2) do anything or is it placebo? my use case is making sure a file is properly written when i expect the system to crash within (potentially less than) a second or so
@puppygirlhornypost2 @lizzy AFAIK fsync() works just fine for most cases, but for "must hit disk ASAP" writes, O_DIRECT will bypass the write cache for a given fd, so as long as the fd is blocking, writes will block until the data hits disk. (I had to do that to an imaging program to make the progress bar work, and given the workload in question, going through the write cache and potentially flushing more useful things was pointless)
EDIT: the biggest problem with fsync is if it fails for some reason, because the spec doesn't say what happens in that case.
fsyncing writes without interfering with other portions of ZFS's internals. fsync flushes to ZIL, but as the ZIL is stable storage, the rest of the FS is free to take however long it wants to do the 'normal' TXG write.