Technical article 125431

fcntl fails with EACCES when setting a record lock on a file located on an NFS mount.

OpenServer 5.0.5OpenServer 5.0.6OpenServer 5.0.7

Written · Last revised

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.

From the Xinuos technical article database, record 125431. Reproduced with permission. The original is at www.sco.com/ta/125431, which is reachable but blocked from search engines.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.