O_DSYNC
O_DSYNC is an open-file status flag requiring write operations to complete with synchronized I/O data integrity, covering data and the metadata needed to retrieve it.
A file-length extension is retrieval-critical; a timestamp-only update is not. Linux compares O_DSYNC write completion to a write followed by fdatasync, not to a metadata-free write. [1] Handle a short write using its returned byte count; the flag does not promise that one call transfers the entire requested application record. [2] Like fdatasync, it is not a replacement for the containing directory's synchronization when name persistence matters. [3]
Relations
- related
- o-sync, fdatasync, fsync, directory-fsync, direct-io
Advantages
- Can avoid synchronization of metadata not required for data retrieval.
Limitations
- Does not guarantee lower latency than O_SYNC on every filesystem.
- Does not provide crash-atomic writes or a multi-file transaction.
- Does not imply direct I/O or page-cache bypass.