[cifs-protocol] Enable handle caching for CA files #Q6- TrackingID#2311070040010094

Baixiang Cpp baixiangcpp at gmail.com
Fri Jan 3 03:45:47 UTC 2025


Hello Metze,

I have recently been using Samba share as NAS storage, and after enabling
CONTINUOUS AVAILABILITY, I noticed a significant drop in performance. My
file operations involve a lot of open/close scenarios. After investigation,
I found that enabling CONTINUOUS AVAILABILITY will cause Windows clients to
disable handle caching.

I noticed that you mentioned this issue on the Samba CIFS-PROTOCOL mailing
list (#Q6- TrackingID#2311070040010094), but I couldn't find an effective
response.

I checked the Windows Group Policy documentation and found that in the CA
scenario, handle caching is disabled by default, but it can be manually
enabled. Here is the documentation :
https://learn.microsoft.com/en-us/windows/client-management/mdm/policy-csp-admx-lanmanworkstation#pol_enablehandlecachingforcafiles
.

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?
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.samba.org/pipermail/cifs-protocol/attachments/20250103/a194ca55/attachment.htm>


More information about the cifs-protocol mailing list