Problem
When trying to set a record lock on a file on an NFS
mount, fcntl(..., F_SETLK, ...) fails and errno is set to
EACCES. The file/record should not be locked as a previous
fcntl call with F_GETLK to check for locks did not show
the record as being locked. Solution
One possible cause for this type of failure is improper name resolution on the NFS server. That is, the problem can be caused by the NFS server's inability to successfully translate the remote client's IP address into a proper hostname that it can then successfully reach.
Check the NFS server's /etc/hosts and/or your DNS configuration for any corruption/inconsistencies, and when corrected, retry the locking operation.