NFS Gateway File Lock Control

IDXfile locking:advisory:NFS Gateway/IDXWhen users share files, the system must provide a mechanism that prevents different users from making simultaneous changes to the same file. If there is not such a mechanism, one user can overwrite the changes another user makes to the file and cause inconsistencies in the file. Both NetWare® and UNIX* systems control simultaneous file access using file locking. File locking ensures that a file is updated correctly before another user, application, or process can access it.IDXfile locking:overview:NFS Gateway/IDX

IDXfile locking:mandatory:NFS Gateway/IDXThe NetWare lock manager sets mandatory (physical) locks that automatically prevent simultaneous file access by NetWare users. The NFS lock manager, when contacted by an application, sets advisory (logical) locks that give warnings if a file is already open but does not prevent another NFS user from accessing the file. An NFS user or process can bypass the advisory lock, causing inconsistencies in the file. A NetWare user, however, cannot bypass the NFS advisory lock, because the NetWare lock manager imposes the mandatory lock for NetWare users upon seeing the NFS advisory lock.

The NFS Gateway uses both NetWare and NFS file locking. To synchronize NetWare and NFS file locking, you must set the Gateway volume option that enables NFS file locking on the remote server. NetWare and NFS synchronized file locking can work only when lock manager software is running on both the NetWare server and the remote NFS server. If the Gateway volume option that requires NFS file locking is turned on and the NFS lock manager is not running, all file locks fail.

Synchronized file locking is recommended for all NFS Gateway volume configurations; synchronized file locking is not necessary if file system access is limited to DOS clients only. The flow chart in "NFS Gateway File Locking Process" shows how NetWare and NFS synchronized file locking works.

Figure 12.
NFS Gateway File Locking Process

When NetWare users access a remote file system through one NFS Gateway, standard file locking synchronization is sufficient. However, if you can access the same remote file system through two different Gateways, the file locking process must use an additional lock mechanism. To accommodate file locking in this situation, the NFS Gateway must send an NFS file lock request to the lock manager on the remote NFS server each time a user accesses a file on the Gateway volume. This ensures that a lock exists on the remote NFS side as well as the NetWare side. If a user tries to open a file through a different NFS Gateway, the lock manager on the remote NFS server will have a record of any locks on the requested file. To accommodate the NFS lock requests sent by the NFS Gateway, the remote NFS server must support and run the NFS/ONC lock protocol program number 10021, version 3.

NOTE: Novell does not recommend accessing the same remote file system through two different NFS Gateways.