Best practices: Adding Persistent Handle support
metze at samba.org
Wed Jun 7 15:00:35 UTC 2017
> Question for you: If SMB2_GLOBAL_CAP_PERSISTENT_HANDLES is clear on the
> connection, can a share still send SMB2_SHARE_CAP_CONTINUOUS_AVAILABILITY?
> That is, are the two completely independent or can the share indicate CA
> even if the connection doesn't provide Persistent Handles?
> Here's what I'm thinking...
> Two new smb.conf parameters:
> * global persistent handles (G) = Yes|Auto|No
> * continuous availability (S) = Yes|Auto|No
> The first of those would control the SMB2_GLOBAL_CAP_PERSISTENT_HANDLES bit,
> and the second would control (per share) the
> SMB2_SHARE_CAP_CONTINUOUS_AVAILABILITY bit in the Tree Connect response.
> The default, in both cases, would be Auto, and here's how it would work:
> global persistent handles:
> Yes = SMB2_GLOBAL_CAP_PERSISTENT_HANDLES will be set by the server to
> indicate that the server supports Persistent Handles.
> Auto = The default. This behaves just like "No" under normal
> circumstances. More in a moment.
> No = SMB2_GLOBAL_CAP_PERSISTENT_HANDLES will not be set by the server.
> In the case of Auto, the VFS module would be permitted to change the value
> to "Yes" at run-time. Basically, SMB2_GLOBAL_CAP_PERSISTENT_HANDLES would
> be disabled unless this value is set to Auto and a VFS module enables it.
How do you want to do that for "auto"? SMB_VFS_CONNECT() is called while
processing the tree connect and that's too late to enable
What is the problem with announcing SMB2_GLOBAL_CAP_PERSISTENT_HANDLES,
but not granting them if a client asks. As far I understand the server
is not required to grant persistent handles.
> continuous availability:
> Essentially the same behavior, but at the Share level. The only
> outstanding question is whether or not the setting of 'global persistent
> handles' will impact the interpretation of 'continuous availability'.
I don't think we should have an "auto" value here too, I think the
administrator should decide if the share should be marked as CA.
I'm not sure if we need to tie the ability of the vfs module to support
persistent handles with announcing the CA bit on the share.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 836 bytes
Desc: OpenPGP digital signature
More information about the samba-technical