Chapter 5 CIFS/9000 File Locking
Implementation
CIFS/9000 mirrors the Windows file locking mechanisms, using the CIFS (SMB) protocol to provide
Mandatory Share Mode Locking (Open Mode),
Opportunistic Locking (Oplocks).
This locking scheme is executed by the CIFS/9000 smbd UNIX process. Every Windows client connection to the CIFS/9000 server starts an individual smbd daemon that administers the client access. The smbd daemon implements the Windows file locking scheme, and interoperates with every other smbd daemon that is running on the local system to coordinate the file locks that each Windows client requests. The CIFS/9000 smbd daemons provide the common interface that ensures the validity of each file lock. However, since the smbd is not executing on the Windows native file server, some client applications using very strict adherence to programmatic native Windows locking protocol could exhibit unexpected behavior.
CIFS/9000 configures file locking in the /etc/opt/samba/smb.conf file. Default values do not need to be explicitly configured in the smb.conf file.
5.1.MANDATORY SHARE MODE LOCKING (OPEN MODE)
– as implemented by CIFS/9000 - uses Windows access modes and share modes.
Access mode: |
|
Read: | Read access only |
Write: | Write access only |
Read and Write access | |
Share mode: |
|
Concurrent read and write access allowed | |
No concurrent read or write access allowed | |
No concurrent read access allowed | |
No concurrent write access allowed |
The Windows client application determines the access mode when calling Createfile. CIFS/9000 disables share mode in the smb.conf file on a per
[share_name]
share modes = no
The default is “yes”, so the parameter is usually not explicitly set unless it is set to “no”. However, most applications expect share mode to be set to yes – don’t change it.
12