Oplocks (opportunistic locks) enable the redirector on a CIFS client in certain file-sharing scenarios to perform client-side caching of read-ahead, write-behind, and lock information. A client can then work with a file (read or write it) without regularly reminding the server that it needs access to the file in question. This improves performance by reducing network traffic.
Under some circumstances, if a process has an exclusive oplock on a file and a second process attempts to open the file, the first process must relinquish the oplock and access to the file. The redirector must then invalidate cached data and flush writes and locks, resulting in possible loss of data that was to be written.
Any application that has write-cached data can lose that data under the following set of circumstances:
The cache itself does not have any error handling--the applications do. When the application makes a write to cache, the write is always completed. If the cache, in turn, makes a write to the target system over a network, it must assume that the write is completed because if it does not, the data is lost.
CIFS oplocks on the filer are On by default.
You might turn CIFS oplocks Off under either of the following circumstances:
Otherwise, you can leave CIFS oplocks On.
You can turn CIFS oplocks On or Off globally for the entire filer or for individual qtrees, which are special directories that are described in detail in Chapter 12, "Qtree administration."
You turn all CIFS oplocks Off with the following options command:
options cifs.oplocks.enable off
You turn CIFS oplocks On with the following options command:
options cifs.oplocks.enable on
You can turn CIFS oplocks On or Off at individual clients. Turning CIFS oplocks On at the filer does not override any client-specific settings. Turning CIFS oplocks Off at the filer disables all oplocks to or from the filer.
For additional information about oplocks, consult the Microsoft Knowledge Base at http://www.microsoft.com/kb.
Copyright © 1999, Network Appliance, Inc. All rights reserved.
Part No. 210-02334
File: cifs25.htm
Last updated: 04/26/99 08:11:33