{
  "slug": "close-to-open-consistency",
  "term": "Close-to-open consistency",
  "aliases": [
    "CTO consistency",
    "close-to-open cache consistency"
  ],
  "definition": "Close-to-open consistency is a file-sharing cache policy that combines writeback at close with validation at a later open to support visibility of updates between sequential users.",
  "note": "An already-open reader is a different case from a new opener. Concurrent access needs application coordination; CTO alone does not serialize simultaneous writers. [nfs-client]\n\nLinux documents NFSv3 open-time checks and close-time writeback. An open sends GETATTR or ACCESS regardless of cached-attribute freshness, and a close writes back pending changes, which also lets close(2) report write errors. Without a new open, revalidation follows the attribute cache timers, by default 3 to 60 seconds for regular files and 30 to 60 seconds for directories. [nfs-client]\n\nNFSv4 delegations can avoid repeated validation and defer writeback. An open under an OPEN delegation needs no validation message, and data written under a write delegation need not reach the server until recall. Persistence still depends on the applicable protocol and error handling. [rfc8881]",
  "related": [
    "nfs-storage",
    "nfs-attribute-cache",
    "nfs-delegation",
    "nfs-commit",
    "nfs-lookup-cache"
  ],
  "limitations": [
    {
      "text": "Linux cto/nocto options differ by version: the NFSv4 setting concerns directories, not file-data caching.",
      "citationIds": [
        "nfs-client"
      ]
    },
    {
      "text": "An application that keeps a file open across another client's update can read stale data until the attribute cache expires.",
      "citationIds": [
        "nfs-client"
      ]
    }
  ],
  "citations": [
    {
      "id": "nfs-client",
      "title": "nfs-utils nfs(5), Debian trixie: data and metadata coherence and version-specific cto/nocto options.",
      "url": "https://manpages.debian.org/trixie/nfs-common/nfs.5.en.html",
      "accessed": "2026-10-23"
    },
    {
      "id": "rfc7530",
      "title": "Haynes and Noveck (editors). NFS Version 4 Protocol. RFC 7530, sections 10.3, 10.4 and 10.6 (NFSv4.0).",
      "url": "https://datatracker.ietf.org/doc/html/rfc7530#section-10",
      "accessed": "2026-10-14"
    },
    {
      "id": "rfc8881",
      "title": "Noveck and Lever (editors). NFS Version 4 Minor Version 1 Protocol. RFC 8881, sections 10.3-10.6 (NFSv4.1).",
      "url": "https://www.rfc-editor.org/rfc/rfc8881.html#section-10",
      "accessed": "2026-10-23"
    },
    {
      "id": "hesela-stability",
      "title": "NFS stable writes: what COMMIT, flush and FUA actually promise",
      "url": "https://hesela.com/analyses/nfs-stable-writes-flush-fua/",
      "accessed": "2026-10-14"
    }
  ],
  "status": "shipping",
  "advantages": [
    {
      "text": "Sequential sharing gets fresh data at open without forcing every read to contact the server.",
      "citationIds": [
        "nfs-client"
      ]
    }
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-10-23",
  "provenance": [
    "nfs-client is the nfs(5) manual page for Debian trixie, re-read 2026-10-23 for the close-to-open section and the acregmin, acregmax, acdirmin and acdirmax defaults.",
    "rfc8881 is RFC 8881, re-read at section 10.4 for open delegations. rfc7530 stays listed for the NFSv4.0 caching model.",
    "A companion analysis of NFS stable writes is listed but not used for any fact here.",
    "The nfs-silly-rename entry links here because silly rename keeps an already-open file usable after unlink, a case the open-time check does not cover."
  ]
}
