Hi Slow,

I've been looking into this issue relating to MS-SMB2 3.3.5.9.12. I'll provide 
an interpretation and if it doesn't make sense, just let me know.

>From MS-SMB2 3.3.5.9.12:
--------------------------------------------------------------------------------------------------------------------------------------
The processing changes involved for this create context are:
§       The server MUST look up an existing Open in the GlobalOpenTable by 
doing a lookup with the FileId.Persistent portion of the create context.
§       If the lookup fails:
§               If the request includes the SMB2_DHANDLE_FLAG_PERSISTENT bit in 
the Flags field of the SMB2_CREATE_DURABLE_HANDLE_RECONNECT_V2 create context, 
TreeConnect.Share.IsCA is TRUE, and Connection.ServerCapabilities includes 
SMB2_GLOBAL_CAP_PERSISTENT_HANDLES, the server MUST look up an existing Open in 
the GlobalOpenTable by doing a lookup with the CreateGuid of the create 
context. If the lookup fails, the server SHOULD<336> fail the request with 
STATUS_OBJECT_NAME_NOT_FOUND and proceed as specified in "Failed Open Handling" 
in section 3.3.5.9.
§               Otherwise, the server SHOULD<337> fail the request with 
STATUS_OBJECT_NAME_NOT_FOUND and proceed as specified in "Failed Open Handling" 
in section 3.3.5.9.
---------------------------------------------------------------------------------------------------------------------------------------

Alternate interpretation of MS-SMB2 3.3.5.9.12 as seen above:
---------------------------------------------------------------------------------------------------------------------------------------
How this context differs from a standard CREATE:
        Server MUST lookup the open with FileID.Persistent
        If this lookup fails using FileID.Persistent:
                If this is a CA share with persistent handle flagged in the 
request, and the server is capable of persistent handles:
                        Try the lookup again, but with the CreateGuid
                        If the lookup with CreateGuid fails:
                                The server SHOULD<345> fail w/ 
STATUS_OBJECT_NAME_NOT_FOUND and proceed w/ "Failed Open Handling" procedure
                If this is either not a CA Share, not a persistent handle 
request, or the server is not capable of persistent handles:
                        The server SHOULD<346> fail w/ 
STATUS_OBJECT_NAME_NOT_FOUND and proceed w/ "Failed Open Handling" procedure
---------------------------------------------------------------------------------------------------------------------------------------

Since the context explanation calls out that these are the "processing changes 
involved for this create context", the document makes the assertion that all 
other conditions should follow that of a normal CREATE. This would include the 
behavior when the lookup succeeds.

Please let me know if you have any additional questions.

Regards,
Kristian Smith
Support Escalation Engineer | Microsoft® Corporation
Email: kristian.sm...@microsoft.com

-----Original Message-----
From: Jeff McCashland (He/him) <je...@microsoft.com>
Sent: Monday, March 17, 2025 9:37 AM
To: Ralph Boehme <s...@samba.org>
Cc: cifs-protocol@lists.samba.org; DMA Interop Data Support 
<askdmasupp...@microsoft.com>
Subject: MS-SMB2 3.3.5.9.12 Handling the 
SMB2_CREATE_DURABLE_HANDLE_RECONNECT_V2 Create Context - 
TrackingID#2503170040010814

[DocHelp to BCC, support on CC, SR ID on Subject]

Hi Ralph,

Thank you for sending in your questions. We have created SR 2503170040010814 to 
track this issue. One of our engineers will respond soon.

Best regards,

Jeff McCashland (He/him) | Senior Escalation Engineer | Microsoft Corporation
Phone: +1 (425) 703-8300
x38300 | Hours: 9am-5pm | Time zone: (UTC-08:00) Pacific Time (US and Canada) 
Local country phone number found here: 
http://support.microsoft.com/globalenglish | Extension 1138300


________________________________________
From: Ralph Boehme
Sent: Monday, March 17, 2025 9:29 AM
To: Interoperability Documentation Help
Cc: cifs-protocol@lists.samba.org
Subject: MS-SMB2 3.3.5.9.12 Handling the 
SMB2_CREATE_DURABLE_HANDLE_RECONNECT_V2 Create Context

Hello dochelp,

another one... :)

In MS-SMB2 3.3.5.9.12 Handling the
SMB2_CREATE_DURABLE_HANDLE_RECONNECT_V2 Create Context there's the following 
paragraph:

---8<---
If the request includes the SMB2_DHANDLE_FLAG_PERSISTENT bit in the Flags field 
of the SMB2_CREATE_DURABLE_HANDLE_RECONNECT_V2
create context, TreeConnect.Share.IsCA is TRUE, and 
Connection.ServerCapabilities includes SMB2_GLOBAL_CAP_PERSISTENT_HANDLES, the 
server MUST look up an existing Open in the GlobalOpenTable by doing a lookup 
with the CreateGuid of the create context. If the lookup fails, the server
                                   ^^^^^^^^^^^^^^^^^^^ A SHOULD<345> fail the 
request with STATUS_OBJECT_NAME_NOT_FOUND and proceed as specified in "Failed 
Open Handling" in section 3.3.5.9.
---8<---

To me it's unclear what has to be done if the marked "If the lookup fails" 
condition is not met, ie when the lookup succeeds, where to continue processing 
in the document? My current understanding of the protocol flow logic would tell 
me to continue with the next sentence which is

---8<---
Otherwise, the server SHOULD<346> fail the request with ^^^^^^^^^ B 
STATUS_OBJECT_NAME_NOT_FOUND and proceed as specified in "Failed Open Handling" 
in section 3.3.5.9.
---8<---

So two questions:

- where to continue if "the lookup" A succeeds ?

- reading "Otherwise" B as the "else" branch of a preceding "if"
expression, which the corresponding "if" expression?

Thanks!
-slow

_______________________________________________
cifs-protocol mailing list
cifs-protocol@lists.samba.org
https://lists.samba.org/mailman/listinfo/cifs-protocol

Reply via email to