1822001 Members
4107 Online
109639 Solutions
New Discussion

NFS nolock option ?

 
MikeL_4
Super Advisor

NFS nolock option ?

I have two Red Hat servers, both running version 5.3 and both patched to the current level... One server, also servers as an NFS server to others....

The application group has a Java application that is aborting with: java.io.IOException: No locks available

I found that if I mount the NFS file system with the "nolock" option there Java application works just fine...

My understanding of nolock, was it was just for use between different versions of NFS... but in this case it works here, which I don't understand why ??

If I use the nolock option, is there any other issues it may cause ??
1 REPLY 1
Matti_Kurkela
Honored Contributor

Re: NFS nolock option ?

The nolock option prevents the exchange of file lock information between the NFS server and this NFS client. The server is not aware of file locks on this client, and vice versa.

Using the nolock option is required if the NFS server has its NFS file lock functionality in a broken or unimplemented state, but it works between any versions of NFS.

If another host accesses the same files as your application on this host, there may be problems if file lock information exchange is disabled.

A failure to maintain proper locking between a write operation on one host and a read operation on another may cause the reader to get incomplete or inconsistent data (reading a line/record/data structure that is only partly written).

A locking failure between two writers is likely to cause data loss/corruption, as the later write overwrites the earlier one. The changes made by the earlier write operation can be lost.

The error message "No locks available" would seem that the file locks are a finite resource, and all the available locks are in use. You might wish to check if the number of file locks per user is limited by "ulimit -x" settings, both on the NFS client and on the server.

You might also take a look at the logs of the NFS server, to see if there are any locking-related messages. Because the NFS server needs to keep track of the sum total of the locks of all its clients, any problem with lock resources would probably be seen there first.

MK
MK