[cifs-protocol] Scope of a File.LeaseKey on the client
Stefan (metze) Metzmacher
metze at samba.org
Thu Oct 18 01:56:08 MDT 2012
is it correct that the LeaseKey on a file is shared between different
From 126.96.36.199 Application Requests Opening a File:
If the client implements the SMB 2.1 or SMB 3.0 dialect and
TRUE, the client MUST search the GlobalFileTable for an entry matching
one of the following:
- The application-supplied PathName if TreeConnect.IsDfsShare is TRUE.
- The concatenation of Connection.ServerName, TreeConnect.ShareName,
application-supplied PathName, joined with pathname separators
if TreeConnect.IsDfsShare is FALSE.
If an entry is not found, a new File entry MUST be created and added
to the GlobalFileTable and a
File.LeaseKey, as specified in section 188.8.131.52, MUST be assigned to
the entry. File.OpenTable
MUST be initialized to an empty table and File.LeaseState MUST be
If the client accesses a file through multiple paths, such as using
different server names or share
names or parent directory names, it will create multiple File
elements, and therefore multiple
File.LeaseKeys for the same remote file. This loses the performance
benefits of sharing cache state
across all Opens of the same file, and may cause additional lease
breaks to be generated, as
actions by a client through one path will affect caching by that
client through other paths. However,
the impact is a matter of performance; cache correctness is preserved.
It seems that the LeaseKey is purely tight to the full path to the file
from the client perspective.
I guess on a terminal server where multiple users access the same path
on the server,
the LeaseKey is shared between them, is that correct?
If this is true, then this implies that each user sees the same content
in a file,
which might not be true.
E.g. in Samba we allow shares to expose different FSA level directories
based on user account.
The typical example is the "homes" share which exposes the unix home
directory of the specific user.
I fear that we have to disable such powerful features if we want to take
advantage of leases,
otherwise the client would treat \\sambaserver\homes\commonfile.doc of
\\sambaserver\homes\commonfile.doc of user2 as the same file.
I assume user1 and user2 should share the client_guid and lease_key,
which means data corruption and/or security problems are very likely,
if the server grants leases in this case.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 259 bytes
Desc: OpenPGP digital signature
More information about the cifs-protocol