HP UX Common Internet File System (CIFS) Client/Server Software File Locking Implementations

Page 8

Chapter 4 File Locking Implementations

File systems and pseudo file systems (like PC-NFS) implement autonomous file locking models. These file-locking models are invoked by the particular file system, and do not necessarily interoperate, or even know each other exist. Thus, when multiple client access methods open the same file – even with valid locking procedures for the opening file system – the locks can be ignored, resulting in concurrent file access and likely data corruption. To understand how the different file locking mechanisms interoperate (or do not interoperate), we must first understand how file locking is implemented for homogeneous access on the following file systems:

Windows (CIFS),

UNIX (JFS, HFS, etc)

NFS,

PC-NFS.

4.1WINDOWS (CIFS)

The Windows file system (using CIFS) utilizes three different file-locking mechanisms:

Mandatory Locking,

Byte-Range Locking,

Opportunistic Locking (Oplocks).

MANDATORY LOCKING is invoked at file open by the Windows Createfile API. Locking parameters supplied to Createfile include access mode and share mode.

Access mode defines how an application (caller of Createfile) wants to access the file:

Read:

Read access only

Write:

Write access only

Read-Write:

Read and Write access

Share mode defines how an application wants to limit or grant concurrent access while it has the file open, essentially comprising the locking scenario for MANDATORY LOCKS:

Deny-None:

Concurrent read and write access allowed

Deny-All:

No concurrent read or write access allowed

Deny-Read:

No concurrent read access allowed

Deny-Write:

No concurrent write access allowed

These are Windows default file locking mechanisms. There are obscure ways to disable mandatory locks, but they should never be disabled (which is why they are obscure). Windows documentation uses the terms “mandatory” and “share mode”. However, it is helpful to think of mandatory share mode locking as “OPEN MODE LOCKING”, because it is initiated during a file open, so subsequent references will use “Mandatory Share Mode (Open Mode) Locking”.

8

Image 8
Contents E0300 Version 1.03 SeptemberEric Roseme Snsl Advanced Technology Center Legal Notices Copyright NoticesContents Introduction CIFS/9000 Product Overview File Locking Overview ACLPage File Locking Implementations Windows CifsPage Unix NFSPC NFS Mandatory Share Mode Locking Open Mode CIFS/9000 File Locking ImplementationPage Page Page Windows only Client Access Local File System CIFS/9000 File Locking Interoperability ExamplesPage Windows only Client Access NFS Mounted File System Page Windows and Unix Client Access Local File System Page Windows and Unix Client Access NFS Mounted File System Page UNIX/NFS PC-NFS Page Unix PC-NFS Page Clients Page Mandatory Share Mode Open Mode CIFS/9000 CIFS/9000 Locking SummaryByte Range Locking OplocksCIFS/9000 Competition Locking Summary Mandatory Share Mode Open Mode Network AppliancePage Mandatory Share Mode Open Mode EMC Celerra EMC CelerraPage Auspex NeTservices Mandatory Share Mode Open Mode Auspex NeTservicesPage Mandatory Share Mode Open Mode Veritas FSE Veritas File Server EditionLocking Summary Table EMCCIFS/9000 File Locking Interoperability Summary Page Smb.conf for Windows-Only Access Appendix a smb.conf ExamplesSmb.conf for Mixed-Mode Access Appendix B Sales Tool Locking Technology Examples Determine Locking RequirementByte Range Locking CIFS/NFS Open Mode Locking CIFS/NFS Open Mode Locking Competitor’s Claims for NFS Non-Locking Protection
Related manuals
Manual 21 pages 36.77 Kb