[cifs-protocol] Trying to let a Windows client use MS-SWN against a samba cluster #Q6- TrackingID#2311070040010094

Sreekanth Nadendla srenaden at microsoft.com
Wed Jan 3 17:04:08 UTC 2024


Hello Metze, below is the answer to your question #6. Let me know your thoughts.

Please note that section 3.2.4.3.5 did not say MUST. It only uses SHOULD. Also, the wording of the section does NOT imply that when requesting durable handle, one cannot request handle caching if TreeConnect.IsCAShare is FALSE.

A client can request both Persistence and Lease (with handle caching enabled). Protocol(or windows) server does not deny granting both persistence and lease, when the requirements are met.

Protocol says that in order to request durable open, client should either set SMB2_DHANDLE_FLAG_PERSISTENT bit in the Flags field of Durable_V2 create context or request for handle caching with Lease create context.

If the share is a CA share (in a Failover Cluster configuration), client can request for handle persistency by setting  SMB2_DHANDLE_FLAG_PERSISTENT bit which provides transparent failover.

Please look at the doc snip from section 3.3.5.9.10, where both TreeConnect.Share.IsCA (SMB2_SHARE_CAP_CONTINUOUS_AVAILABILITY)  and SMB2_GLOBAL_CAP_PERSISTENT_HANDLES  are required in order to set Open.IsPersistent to TRUE.  This is a server requirement though.

On the client side, it is imperative that CA shares will require persistence handles to work with. In other words, for the server to grant persistent handle on an open, client must set SMB2_GLOBAL_CAP_PERSISTENT_HANDLES.

In the "Successful Open Initialization" phase, if the underlying object store does not grant durability, the server MUST skip the rest of the processing in this section. Otherwise, the server MUST set Open.IsDurable to TRUE. The server MUST also set Open.DurableOwner to a security descriptor accessible only by the user represented by Open.Session.SecurityContext. If the SMB2_DHANDLE_FLAG_PERSISTENT bit is set in the Flags field of the request, TreeConnect.Share.IsCA is TRUE, and Connection.ServerCapabilities includes SMB2_GLOBAL_CAP_PERSISTENT_HANDLES, the server MUST set Open.IsPersistent to TRUE.


  *   - - - - ORIGINAL TEXT FROM METZE - - - -

3.2.4.3.5 Application Requests Creating a File Opened for Durable Operation

   ...

   -  If TreeConnect.IsCAShare is TRUE, the client MUST set the
      SMB2_DHANDLE_FLAG_PERSISTENT bit in the Flags field. Otherwise, the client SHOULD
      perform one of the following:

        - Request a batch oplock by setting RequestedOplockLevel in the create request to
          SMB2_OPLOCK_LEVEL_BATCH.

        - Request a handle caching lease by including an SMB2_CREATE_REQUEST_LEASE or
          SMB2_CREATE_REQUEST_LEASE_V2 Create Context in the create request with a
          LeaseState that includes SMB2_LEASE_HANDLE_CACHING.

    ...

Question 6:
 From the documentation the above is the only reference that is impacted by SMB2_SHARE_CAP_CONTINUOUS_AVAILABILITY and it seems that it implicitly disables handle caching, is that really true?

And SMB2_DHANDLE_FLAG_PERSISTENT doesn't seem to be impacted by
SMB2_GLOBAL_CAP_PERSISTENT_HANDLES, which is strange.
Can you please cross-check this?



Regards,

Sreekanth Nadendla

Microsoft Windows Open Specifications


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.samba.org/pipermail/cifs-protocol/attachments/20240103/35f80e46/attachment.htm>


More information about the cifs-protocol mailing list