{
  "slug": "fdatasync",
  "term": "fdatasync",
  "aliases": [
    "fdatasync()"
  ],
  "definition": "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.",
  "note": "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. [fsync-api]\n\nLinux 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. [fsync-api]\n\nA 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. [rebello]",
  "status": "shipping",
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-22",
  "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."
  ],
  "related": [
    "fsync",
    "msync",
    "sync-file-range",
    "writeback-error",
    "o-dsync",
    "o-sync",
    "file-truncation",
    "directory-fsync",
    "o-rsync"
  ],
  "citations": [
    {
      "id": "fsync-api",
      "title": "Linux man-pages 6.19: fsync(2), fdatasync metadata requirements",
      "url": "https://man7.org/linux/man-pages/man2/fsync.2.html",
      "accessed": "2026-11-22"
    },
    {
      "id": "hesela-fsync",
      "title": "Hesela: Why retrying a failed fsync does not prove durability",
      "url": "https://hesela.com/analyses/fsync-failure-retry-durability/",
      "accessed": "2026-10-13"
    },
    {
      "id": "rebello",
      "title": "Rebello et al., Can Applications Recover from fsync Failures? USENIX ATC 2020, sections 3.2-3.3 and 5",
      "url": "https://research.cs.wisc.edu/wind/Publications/atc20-cuttlefs.pdf",
      "accessed": "2026-11-22"
    }
  ],
  "provenance": [
    "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."
  ]
}
