Storage glossary · JSON corpus · llms.txt · hesela.com

o-sync · shipping · also synchronized I/O file integrity completion

O_SYNC

O_SYNC is an open-file status flag requiring write operations to complete with synchronized I/O file integrity, covering data and associated file metadata.

Related Observatory article: O_SYNC on hesela.com

On Linux this provides the completion semantics of a write followed by fsync, whereas O_DSYNC requires only the metadata needed to retrieve the data. Neither flag requires O_DIRECT or means the page cache is bypassed. [1] A positive write result can be shorter than requested: check the returned byte count as well as errors before declaring the application record complete. [2] File synchronization does not by itself establish persistence of a newly created directory entry. [3]

Relations

related
o-dsync, fdatasync, fsync, directory-fsync, direct-io, open-file-description

Advantages

Limitations

Citations

  1. Linux man-pages 6.19: open(2), O_SYNC and O_DSYNC (accessed 2026-10-15)
  2. POSIX.1-2024: write(), synchronized I/O and partial writes (accessed 2026-10-15)
  3. Linux man-pages 6.19: fsync(2), metadata and directory synchronization (accessed 2026-10-15)
  4. Hesela: Why retrying a failed fsync does not prove durability (accessed 2026-10-15)

JSON: /data/terms/o-sync.json