fdatasync · shipping · also fdatasync()

fdatasync

fdatasync is a file-synchronization operation that persists modified data and the metadata required to retrieve it, without requiring synchronization of all other file metadata.

Related Observatory article: Read on hesela.com

File-size changes must be synchronized because retrieval depends on them; timestamp-only changes need not be. Data-only completion is therefore not metadata-free completion. Like file fsync, fdatasync does not establish persistence of its containing directory entry. Check errors before acknowledging a commit. [1]

Linux reports EIO for synchronization failures and can report ENOSPC or EDQUOT when allocation was deferred beyond write(). An EIO may concern another descriptor's writes to the same file. A successful buffered write is not a guarantee that later synchronization will succeed. [1]

A later successful synchronization is not evidence that previously lost data was reconstructed. In Rebello et al.'s Linux 5.2.11 fsync fault-injection study, failed-write pages could become clean, so retrying fsync need not resubmit them. This is evidence about post-failure recovery, not a measurement of every fdatasync implementation. [3]

Relations

related
fsync, msync, sync_file_range, Writeback error, O_DSYNC, O_SYNC, File truncation, Directory fsync, O_RSYNC

Advantages

  • Can avoid metadata work that is unnecessary for data retrieval.

Limitations

  • Not a transaction across files or a substitute for directory synchronization.
  • Less required metadata work does not guarantee lower latency on every filesystem.

Citations

  1. Linux man-pages 6.19: fsync(2), fdatasync metadata requirements (accessed 2026-11-22)
  2. Rebello et al., Can Applications Recover from fsync Failures? USENIX ATC 2020, sections 3.2-3.3 and 5 (accessed 2026-11-22)

Further reading

  1. Hesela: Why retrying a failed fsync does not prove durability (accessed 2026-10-13)
Sources & caveats
  • The paper's file-system experiments used Linux 5.2.11 and targeted transient block-write faults; its results do not establish behavior for every later kernel or fdatasync path.

JSON: /data/terms/fdatasync.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. fdatasync. Hesela. 2026-11-22. https://hesela.dev/terms/fdatasync/