Kernel oplocks is an smb.conf
parameter that notifies Samba (if
the UNIX kernel has the capability to send a Windows client an oplock
break) when 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 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.
The default is no.
Veto oplocks
is an 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 file
caching without the risk of data corruption. Veto oplocks can be
enabled on a per-share basis, or globally for the entire server, in the
smb.conf
file as shown in
???.
Example16.1.Share with Some Files Oplocked
|
[global]
|
veto oplock files = /filename.htm/*.txt/
|
|
[share_name]
|
veto oplock files = /*.exe/filename.ext/
|
oplock break wait time is an smb.conf
parameter
that adjusts the time interval for Samba to reply to an oplock break request. Samba recommends:
“Do not change this parameter unless you have read and understood the Samba oplock code.”
Oplock break wait time can only be configured globally in the smb.conf
file as shown:
oplock break wait time = 0 (default)
|
Oplock break contention limit
is an smb.conf
parameter that limits the
response of the Samba server to grant an oplock if the configured
number of contending clients reaches the limit specified by the parameter. Samba recommends
“Do not change this parameter unless you have read and understood the Samba oplock code.”
Oplock break contention limit can be enabled on a per-share basis, or globally for
the entire server, in the smb.conf
file as shown in
???.
Example16.2.Configuration with Oplock Break Contention Limit
|
[global]
|
oplock break contention limit = 2 (default)
|
|
[share_name]
|
oplock break contention limit = 2 (default)
|