Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Using Samba
Prev Home Next

5.5.2 Unix and Locking

Windows systems cooperate well to avoid overwriting each other's changes. But if a file stored on a Samba system is accessed by a Unix process, this process won't know a thing about Windows oplocks and could easily ride roughshod over a lock. Some Unix systems have been enhanced to understand the Windows oplocks maintained by Samba. Currently the support exists only in SGI Irix 6.5.2f and later; Linux and FreeBSD should soon follow.

If you have a system that understands oplocks, set kernel oplocks = yes in the Samba configuration file. That should eliminate conflicts between Unix processes and Windows users.

If your system does not support kernel oplocks, you could end up with corrupted data when somebody runs a Unix process that reads or writes a file that Windows users also access. However, Samba provides a rough protection mechanism in the absence of kernel oplocks: the veto oplock files option. If you can anticipate which Samba files are used by both Windows users and Unix users, set their names in a veto oplock files option. This will suppress the use of oplocks on matching filenames, which will supress client caching, and let the Windows and Unix programs use system locking or update times to detect competition for the same file. A sample option is:


veto oplock files = /*.dbm/

This option allows both Unix processes and Windows users to edit files ending in the suffix .dbm. Note that the syntax of this option is similar to veto files.

Samba's options for locks and oplocks are given in Table 5.8.


Table 5.8: Locks and Oplocks Configuration Options

Option

Parameters

Function

Default

Scope

share modes

boolean

If set to yes, turns on support for DOS-style whole-file locks.

yes

Share

locking

boolean

If yes, turns on byte-range locks.

yes

Share

strict locking

boolean

If yes, denies access to an entire file if a byte-range lock exists in it.

no

Share

oplocks

boolean

If yes, turn on local caching of files on the client for this share.

yes

Share

kernel oplocks

boolean

If yes, indicates that the kernel supports oplocks.

yes

Global

fake oplocks

boolean

If yes, tells client the lock was obtained, but doesn't actually lock it.

no

Share

blocking locks

boolean

Allows lock requestor to wait for the lock to be granted.

yes

Share

veto oplock files

string (list of filenames)

Does not oplock specified files.

None

Share

lock directory

string (fully-qualified pathname)

Sets the location where various Samba files, including locks, are stored.

As specified in Samba makefile

Global

Using Samba
Prev Home Next

 
 
  Published under the terms of the Creative Commons License Design by Interspire