3 ms·
Does anybody know how Linux NFS handles new OFD-owned file locks? Are they also mapped to classic POSIX locks? OFD-owned locks are a cross of BSD flock and POS
by wahern 3y ago
Does anybody know how Linux NFS handles new OFD-owned file locks? Are they also mapped to classic POSIX locks?
OFD-owned locks are a cross of BSD flock and POSIX fcntl/lockf locks. An original proposal is described at https://lwn.net/Articles/586904/ https://lwn.net/Articles/586904/, but the naming convention settled on OFD-owned (open file descriptor-owned) rather than file-private. I believe Linux was the first to get an implementation. They're also included in the latest POSIX/SUSv5 draft; "POSIX locks" will become ambiguous in the next year or two.
- dooglius 3y agoNot quite answering your question, but the man page says Conflicting lock combinations (i.e., a read lock and a write lock or two write locks) where one lock is an open file description lock and the other is a traditional record lock conflict even when they are acquired by the same process on the same file descriptor.
- wahern 3y agoI think that answers it. And looking back at the specification in the SUSv5 draft, it seems this and analogous behavior has been codified--an OFD lock conflicts with a process-private lock and vice-versa. So there's only one reasonable option for mapping OFD locks to NFS locks, which is that they both map to the same NFS server lock in the same manner (unlike BSD flock, both support record locking).