CIFS Administration 7-33
8VLQJ2SORFNV
:KDW2SORFNV'R
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 perfor-
mance by reducing network traffic.
:KHQWR8VH2SORFNV
Under some circumstances, if a process has an exclusive oplock on a file and a sec-
ond 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.
'DWD/RVV3RVVLELOLWLHV
Any application that has write-cached data can lose that data under the following set
of circumstances:
It has an exclusive oplock on the file.
It is told to either break that oplock or close the file.
During the process of flushing the write cache, the network or target system
generates an error.
(UURU+DQGOLQJ$QG:ULWH&RPSOHWLRQ
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.
:KHQWR7XUQ2SORFNV2II
CIFS oplocks on the filer are On by default.
You might turn CIFS oplocks Off under either of the following circumstances:
You are using a database application whose documentation recommends that
oplocks be turned Off.
You are handling critical data; that is, you have a good network but you cannot
afford even the slightest data loss.
Otherwise, you can leave CIFS oplocks On.