{
  "slug": "sync-file-range",
  "term": "sync_file_range",
  "aliases": [
    "sync_file_range()"
  ],
  "definition": "sync_file_range is a Linux-specific operation that initiates or waits for page-cache writeback over a file range without synchronizing file metadata or flushing volatile device write caches.",
  "note": "Combining WAIT_BEFORE, WRITE and WAIT_AFTER does not remove those omissions. Preallocated space can still require allocation metadata updates, and copy-on-write overwrites cannot assume in-place blocks. Use it to control writeback, not as a general replacement for fdatasync or fsync.",
  "status": "shipping",
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-10-13",
  "advantages": [
    "Allows applications to control writeback over selected file ranges."
  ],
  "limitations": [
    "Linux-specific; not a portable persistence interface.",
    "WRITE alone may block under request-queue pressure.",
    "A successful return does not establish crash-safe availability of the data."
  ],
  "related": [
    "fsync",
    "fdatasync",
    "msync",
    "writeback-error"
  ],
  "citations": [
    {
      "id": "sync-range-api",
      "title": "Linux man-pages 6.19: sync_file_range(2), Warning and flag combinations",
      "url": "https://man7.org/linux/man-pages/man2/sync_file_range.2.html",
      "accessed": "2026-10-13"
    },
    {
      "id": "hesela-fsync",
      "title": "Hesela: File and mapped-range synchronization boundaries",
      "url": "https://hesela.com/analyses/fsync-failure-retry-durability/",
      "accessed": "2026-10-13"
    }
  ]
}
