Advisory file lock
An advisory file lock coordinates access among cooperating participants without itself preventing access that bypasses the locking protocol.
On local Linux filesystems, flock() locks follow open file descriptions; a replacement pathname can refer to a different file. Hesela's ordered subprocess observation acquires a second lock after target replacement while the old file remains locked. Retaining a separate coordination file preserves the tested conflict; deleting and recreating it loses that shared identity. [1] [2]
A conflicting nonblocking shared-to-exclusive flock conversion can discard the caller's earlier protection. In Hesela's ordered local-Linux experiment, a cooperating writer changed the same file before the caller reacquired; F_SETLK and F_OFD_SETLK retained exclusion in corresponding controls. Reacquisition does not validate an earlier read. The 72 executions used one kernel, not 72 independent systems. [1] [4]
The downloadable packet contains native C code, Python replay, raw traces, source receipts and checksums. This is not a crash, NFS/SMB or failure-rate experiment. [5]
Relations
- related
- Open-file-description lock, Open file description, Atomic rename, Unlink, Process-associated record lock, flock
Limitations
- A lock does not substitute for file or directory synchronization. [3]
- NFS and SMB/CIFS can change flock interaction and enforcement; this local experiment does not test them. [1]
- All participants must coordinate on the same stable file using compatible locking operations. [3]
Citations
- Linux man-pages 6.19: flock(2), ownership and filesystem differences
- Hesela: local Linux lock-identity observation, source hash and limitations
- Hesela: A lock follows the opened file, not the replacement name
- Hesela: 72 ordered local-Linux lock-conversion observations, one kernel
- Hesela: frozen lock-conversion code, raw observations and offline replay