I have setup a NFS4 server and client on opensuse 11.4 KDE.
When I open a textfile on the client I can edit the file. Before saving this file, I open the file on the server as well. Strangely, I don’t get an error that the file is locked. It just notices that the file needs to be repared. But I can edit and save the file on the server. If I then close the file on the client (without saving) and reopen the file on the client, the changes saved on the server are visible.
This means that there seems to be no file locking whatsoever. How can I enable file locking so that a popup will show on the server that the file is already open on another pc, and I can only open the file readonly?
This is my /etc/exports on the server:
/nfs4exports 10.0.2.0/24(fsid=0,ro,insecure,all_squash,sync,no_subtree_check,anonuid=1000,anongid=100) 192.168.1.0/24(fsid=0,ro,insecure,all_squash,sync,no_subtree_check,anonuid=1000,anongid=100)
/nfs4exports/data 10.0.2.0/24(rw,nohide,insecure,all_squash,sync,no_subtree_check,anonuid=1000,anongid=100) 10.0.2.0/24(rw,nohide,insecure,all_squash,sync,no_subtree_check,anonuid=1000,anongid=100)
This is my entry in /etc/fstab on the client:
10.0.2.0/24:/data /media/data nfs4 defaults,user 0 0