Enabling advisory file locking

Applies To: Windows Server 2003 R2

In Windows, file locking is mandatory. In UNIX, file locking is advisory.

By default, Server for NFS file shares use mandatory file locking. This is generally not a problem, but can affect some UNIX applications.

To configure Windows to use advisory file locking, you must clear the EnableSMBLocking registry key.

To modify the Advisory Locking registry value

  1. Open the Registry Editor.

  2. Set the following registry key to 0:

    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\NfsSvr\NlmNsm\EnableSMBLocking

    Warning

    Setting this registry value turns off mandatory locks only for Network File System (NFS) lock requests. Windows applications continue to use mandatory locks. As a result, if one NFS client obtains a read/write lock on a file, then other NFS clients that are also using NLM locks before accessing a file for read/write will honor that lock. However, any Windows application can still modify the file, either through a server message block (SMB) share, or when running on the computer where the file is located, because advisory locks do not actually lock the file on the server. Additionally, although an NFS client may have obtained a lock on a file, a Windows application (either running locally or accessing the file through a CIFS share) can get a mandatory lock on the file, thereby preventing the NFS client from accessing the file, even though the NFS client has a read/write lock on the file.