HP CIFS Opportunistic Locking Usage Guidelines

7
Chapter 3 CIFS/9000 Oplock Configuration
OPPORTUNISTIC LOCKING (Oplocks) is implemented by the CIFS/9000
server on a per -share basis in the smb.conf file. CIFS/9000 Oplock functionality operates
just like Windows. Oplocks are enabled by default for each share, which allows the Windows
client to cache a local copy of a file for:
Read-ahead
Write-caching
Lock caching
CIFS/9000 disables Oplocks on a per -share basis in the smb.conf file:
[share_name]
oplocks = no
The default is “yes”. The default oplock type is Level1.
CIFS/9000 enables Level2 Oplocks on a per -share basis in the smb.conf file:
[share_name]
level2 oplocks = yes
The default is “no”. Oplocks must also be set to “yes” for the Level2 oplock parameter to
function.
Kernel oplocks is a Samba smb.conf parameter that notifies Samba if the UNIX kernel has
the capability to send a Windows client an Oplock Break if a UNIX process is attempting to
open the file that is cached. This parameter addresses sharing files between UNIX and
Windows with Oplocks enabled on the a Samba server: the UNIX process can open the file
that is Oplocked (cached) by the Windows client and the smbd process will not send an
Oplock break, which exposes the file to the risk of data corruption. If the UNIX kernel has
the ability to send an Oplock break, then the kernel oplocks parameter enables Samba to
send the Oplock break. Kernel oplocks are enabled on a per -server basis in the smb.conf file.
However, CIFS/9000 currently does not support kernel oplocks, so the parameter has no
effect:
[global]
kernel oplocks = yes
The default is “no”. The planned enhancement for CIFS/9000 Oplocks will likely utilize this
parameter.
Veto oplocks is a smb.conf parameter that identifies specific files for which Oplocks are
disabled. When a Windows client opens a file that has been configured for veto oplocks, the
client will not be granted the oplock, and all operations will be executed on the original file
on disk instead of a client-cached file copy. By explicitly identifying files that are shared
with UNIX processes, and disabling Oplocks for those files, the server-wide Oplock
configuration can be enabled to allow Windows clients to utilize the performance benefit of