{
  "slug": "rwf-dsync",
  "term": "RWF_DSYNC",
  "aliases": [
    "per-write data-integrity completion"
  ],
  "definition": "RWF_DSYNC is a Linux per-write flag that requests synchronized data-integrity completion for the range written by pwritev2().",
  "note": "Documented since Linux 4.7, this is the per-call counterpart of O_DSYNC, and does not change the synchronization mode stored in the open file description. Within the preadv2/pwritev2 pair, the flag affects writes, not reads; check the returned byte count for a short transfer. [rwf-api]\n\nData-integrity completion includes metadata needed to retrieve the data, such as a file-length extension; it is not a metadata-free write. A timestamp-only change does not have the same retrieval requirement. [open-api]\n\nLinux v6.12 combines per-call synchronization bits with inherited open-mode bits: RWF_DSYNC does not downgrade an O_SYNC file. This is source inspection, not a power-loss test. [linux-sync-flags]\n\nA historical ext3-ordered experiment in OSDI 2014 found that synchronizing one file waited for another file's earlier data. This illustrates coupled persistence work, not an RWF_DSYNC latency measurement. [alice-coupled-sync]",
  "advantages": [
    "Selects data-integrity completion for a write without reopening the file."
  ],
  "limitations": [
    "Does not provide torn-write protection or a multi-file transaction.",
    "Does not establish persistence of a new directory entry.",
    "Does not promise a smaller physical flush or lower latency."
  ],
  "related": [
    "rwf-sync",
    "o-dsync",
    "fdatasync",
    "directory-fsync",
    "short-write",
    "rwf-atomic",
    "open-file-description"
  ],
  "citations": [
    {
      "id": "rwf-api",
      "title": "Linux man-pages: readv(2), per-write flags and short transfers",
      "url": "https://man7.org/linux/man-pages/man2/readv.2.html",
      "accessed": "2026-11-12"
    },
    {
      "id": "open-api",
      "title": "Linux man-pages: open(2), synchronized I/O completion",
      "url": "https://man7.org/linux/man-pages/man2/open.2.html",
      "accessed": "2026-11-12"
    },
    {
      "id": "linux-sync-flags",
      "title": "Linux v6.12: init_sync_kiocb, iocb_flags, kiocb_set_rw_flags and generic_write_sync",
      "url": "https://github.com/torvalds/linux/blob/adc218676eef25575469234709c2d87185ca223a/include/linux/fs.h",
      "accessed": "2026-11-12"
    },
    {
      "id": "hesela-sync-range",
      "title": "Hesela: Per-write flags add requirements; they do not downgrade the open mode",
      "url": "https://hesela.com/analyses/linux-atomic-writes-durability/#per-write-sync",
      "accessed": "2026-11-12"
    },
    {
      "id": "fsync-api",
      "title": "Linux man-pages: fsync(2), file and directory persistence",
      "url": "https://man7.org/linux/man-pages/man2/fsync.2.html",
      "accessed": "2026-11-12"
    },
    {
      "id": "alice-coupled-sync",
      "title": "Pillai et al., OSDI 2014: All File Systems Are Not Created Equal, section 4.6 (p. 445)",
      "url": "https://files.usenix.org/s3fs-public/cdn/osdi14-paper-pillai.pdf",
      "accessed": "2026-11-12"
    }
  ],
  "status": "shipping",
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-12"
}
