Artificial intelligent assistant

flock(2) versus fcntl(2) over a NFS The Perl 5.x documentation states that its implementation of flock(..) will use one of the following native calls, starting at 1 and working toward 3 if unavailable: 1. flock(2) 2. fcntl(2) 3. lockf(3) That's fine. However, you may have noticed their disclaimer that flock(2) should not be used over a NFS. The doc suggests using a -Ud_flock flag to force Perl to use flock(2). The man page of flock(2) (on Redhat) states a similar disclaimer about NFS issues. **My question is, why!?!? I can't seem to find an in-depth article or explanation of WHY flock(2) is unsafe over a NFS.** I've written several test scripts in C and Perl, on both Redhat (where flock(2) is being used) and on Solaris (where fcntl(2) is being used). I ran strace/truss to ensure that Perl was indeed using flock(2) and fcntl(2) respectively. I could not replicate any issues where a lock was not being honored! What gives??

Lennart Poettering recently did some digging into linux filesystem locking behaviour, which doesn't paint a particularly rosy picture for locking over NFS (especially the follow-up he links to at the bottom of the post).

<

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy d4a2f3ce478654de81a73984a9c92c84