open-file-description-lock · shipping · also OFD-owned file lock, OFD record lock

Open-file-description lock

An open-file-description lock is a byte-range file lock owned by an open file description rather than by a process.

Related Observatory article: Open-file-description lock on hesela.com

Linux supports the fcntl F_OFD_* operations from 3.15. Duplicated descriptors share ownership; independent opens can conflict. Automatic release occurs on the last close of that description, unlike traditional process-owned record locks, which a close of any descriptor for the file can release. Explicit unlocking is separate. Although flock() also has open-description ownership on Linux, it is not this byte-range API. [1] In Hesela's local Linux observation, a duplicate could reapply the held lock, closing the initial holder did not release it while the duplicate stayed open, and explicit unlock through the duplicate released it. These are ownership observations, not crash tests. [3]

Relations

related
advisory-file-lock, open-file-description, atomic-rename, process-associated-record-lock

Limitations

Citations

  1. Linux man-pages 6.19: fcntl_locking(2), record and open-file-description locks (accessed 2026-10-16)
  2. Hesela: A lock follows the opened file, not the replacement name (accessed 2026-10-16)
  3. Hesela: Native OFD ownership experiment, source, controls and observations (accessed 2026-10-16)

JSON: /data/terms/open-file-description-lock.json