How do I disable opportunist locking?

John Savill

April 22, 2001

1 Min Read
ITPro Today logo in a gray background | ITPro Today

A. Windows XP and Windows 2000 support opportunist locking, which lets Sever Message Block (SMB) clients lock a file on the server and cache the information, without having to worry whether another user might change the file (earlier Windows versions also support this feature, but the method is different). Opportunist locking leads to better performance for the user. However, it adds a workload to the server, which must maintain and manage the locks. You can use one of two methods to disable opportunist locking.

Method 1

  1. Start regedit.exe.

  2. Go to HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesMRxSmbParameters.

  3. From the Edit menu, select New, DWORD value.

  4. Enter a name of OplocksDisabled, and press Enter.

  5. Double-click the new value, and set it to 1.

  6. Click OK.

Method 2

  1. Start regedit.exe.

  2. Go to HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServiceslanmanserverparameters.

  3. From the Edit menu, select New, DWORD value.

  4. Enter a name of EnableOplocks and press Enter.

  5. Double-click the new value, and set it to 0.

  6. Click OK.

In addition, under the HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServiceslanmanserverparameters, you can set the following optional parameters to tune opportunist locking:

  • MinLinkThroughput (DWORD)—The minimum number of bytes per second that must be maintained through the server before the lock is disabled (0 to infinite)

  • MaxLinkDelay (DWORD)—The maximum time allowed for a delay in the link before the lock is disabled (0 to 100,000 seconds)

  • OplockBreakWait (DWORD)—The time the server waits for a client holding a lock to respond to a lock break request before forcefully breaking the lock (10 to 180 seconds)

About the Author

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like