fsync · shipping · also fsync()

fsync

fsync is a file-synchronization operation that requests persistence of a file's modified data and associated metadata before reporting completion.

Related Observatory article: Read on hesela.com

On Linux, syncing the file does not necessarily persist its containing directory entry; the directory needs its own sync. fdatasync may omit metadata unnecessary for retrieving the data, but must include required file-size changes. A failed sync must be treated as an unresolved durability event, not silently replaced by a later successful return.

OpenZFS sync=disabled ignores application synchronous requests, whereas logbias=throughput changes the storage path without disabling synchronous semantics. [4]

For an asynchronous io_uring sync, establish dependencies on the intended writes before treating its completion as their persistence boundary. [5] In F2FS with checkpointing disabled, the audited regular-file fsync path can return successful data-writeback status before recovery metadata; inspect the effective configuration. [6]

FUSE: Linux v6.12 converts an ENOSYS reply to FUSE_FSYNC into success and suppresses later daemon FSYNC requests on that connection, while retaining preceding writeback checks. Backend persistence still depends on the daemon. [8]

For descriptor-backed C output streams, check fflush before fsync. Pending library-buffer bytes are outside the file synchronization request. The separate stream and file completion boundaries must both be checked. [9]

Darwin F_FULLFSYNC adds a drive-cache flush request to file synchronization. [10] In SQLite, synchronous=FULL controls synchronization timing, not selection of the fullfsync method. [11]

Relations

related
Crash consistency, Writeback error, Write-back cache, Directory fsync, Persistence ordering, Direct I/O, fdatasync, msync, sync_file_range, Open file description, ZFS Intent Log, io_uring, io_uring drain, F2FS checkpoint, syncfs, O_SYNC, O_DSYNC, close, FUSE, fflush, fclose, fwrite, F_FULLFSYNC

Citations

  1. OpenZFS 2.3: zfsprops(7), sync and logbias (accessed 2026-10-14)
  2. liburing: io_uring_enter(2), IORING_OP_FSYNC ordering (accessed 2026-10-14)
  3. Linux v6.16 fs/f2fs/file.c: regular-file writeback and SBI_CP_DISABLED return. (accessed 2026-10-15)
  4. Linux v6.12: fuse_fsync and connection-scoped no_fsync handling (accessed 2026-10-18)
  5. Linux man-pages 6.19: fflush(3) (accessed 2026-10-21)
  6. Apple archived fcntl(2): F_FULLFSYNC (accessed 2026-11-13)
  7. SQLite: Synchronization Type Flags (accessed 2026-11-13)

Further reading

  1. Linux man-pages 6.19: fsync(2) (accessed 2026-10-10)
  2. Hesela: Why retrying a failed fsync does not prove durability (accessed 2026-10-10)
  3. Hesela: Atomic rename is not a durable commit (accessed 2026-10-11)
  4. F2FS: when a successful fsync is not a recovery promise (accessed 2026-10-15)

JSON: /data/terms/fsync.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. fsync. Hesela. 2026-11-13. https://hesela.dev/terms/fsync/