Hi Kristian,

ok, thanks!

On 12/9/25 11:23 PM, Kristian Smith wrote:
Hi slow,

I have an answer regarding the scenario where a byte-range lock changes the 
ability for a reconnecting client to reclaim RH leasing.

Since the byte-range lock remains upon reconnect, the logic from the filesystem 
prevents SMB from reacquiring an RH lease. The filesystem logic is documented 
in MS-FSA section 2.1.5.18 Server Requests an Oplock.

------------------------------------------------
2.1.5.18 Server Requests an Oplock

If RequestedOplockLevel is READ_CACHING or (READ_CACHING|HANDLE_CACHING):
         The operation MUST be failed with STATUS_OPLOCK_NOT_GRANTED under 
either of the following conditions:
                 Open.Stream.ByteRangeLockList is not empty and 
Open.Stream.AllocationSize is greater than any ByteRangeLock.LockOffset in 
Open.Stream.ByteRangeLockList.
                 Open.Mode contains either FILE_SYNCHRONOUS_IO_ALERT or 
FILE_SYNCHRONOUS_IO_NONALERT.
-----------------------------------------------

If you have any additional clarifying questions, please let me know. I'm also 
happy to set up a call if that's easier.

Regards,
Kristian Smith
Escalation Engineer | Microsoft(r) Corporation
Email: [email protected]

-----Original Message-----
From: Obaid Farooqi <[email protected]>
Sent: Thursday, December 4, 2025 4:34 PM
To: Ralph Boehme <[email protected]>
Cc: Kristian Smith <[email protected]>; Microsoft Support 
<[email protected]>; cifs-protocol <[email protected]>
Subject: RE: [EXTERNAL] Re: [MS-SMB2] disconnected PH looses RH lease - 
TrackingID#2509240040006811

Hi Ralph:
I am assisting Kristian with this case.
You said below that you modified the test case to remove brl. Which test case 
is that?

Regards,
Obaid Farooqi
Sr. Escalation Engineer | Microsoft

-----Original Message-----
From: Ralph Boehme <[email protected]>
Sent: Sunday, September 14, 2025 10:43 AM
To: Kristian Smith <[email protected]>
Cc: [email protected]; Microsoft Support <[email protected]>
Subject: [EXTERNAL] Re: [MS-SMB2] disconnected PH looses RH lease - 
TrackingID#2508130040006291

Hi Kristian,

thanks for looking into this!

So it seems server side processing is dependent on whether the file has a brl 
nor not. Until now all my tests were always taking a brl.

Modifying the test to not take a brl (and I'm going to duplicate my whole test 
matrix to cover both cases), the behavior changes to

1. Client 1 opens a file with PH, lease=RH, sharemode=NONE 2. Client 1 disconnects 
TCP 3. Client 2 wants to open the file for reading, server returns STATUS_PENDING 
4. Client 1 reconnects SMB 5. Client 1 reconnects PH and in the response the lease 
state is RH 6. Server sends lease break RH->R to client 1, client 1 ACKs the 
break 7. Server continues to process CREATE from step 3 and fails the request with 
STATUS_SHARING_VIOLATION.

So it the absence vs presence of a brl *completely* changes server processing. 
I'm currently a bit lost trying to make sense of it, figuring out the guiding 
principles all this is based on.

Thanks!
-slow


On 9/8/25 7:27 PM, Kristian Smith wrote:
Hi Slow,

With regard to the following circumstance for which you've outlined and 
gathered traces:

"
1. Client 1 opens a file with PH, lease=RH, sharemode=NONE 2. Client 1
disconnects TCP 3. Client 2 wants to open the file for reading, this
fails with STATUS_FILE_NOT_AVAILABLE 4. Client 1 reconnects SMB 5.
Client 1 reconnects PH and in the response the lease state is NONE
(and the epoch is unchanged) "

I've debugged the scenario after locating the smbtorture test used and found 
that Windows has a condition where an existing byte range lock on a file will 
cause a reconnect request with RH to result in a response with a lease state of 
NONE. This is a unique scenario that I will work with the documentation team to 
specify in [MS-FSA]. Thanks for bringing this to our attention and helping us 
maintain accuracy in the docs. If you have any questions or concerns, please 
let me know.

Regards,
Kristian Smith
Support Escalation Engineer | Microsoft(r) Corporation
Email: [email protected]

-----Original Message-----
From: Kristian Smith
Sent: Wednesday, August 27, 2025 3:25 PM
To: 'Ralph Boehme' <[email protected]>
Cc: '[email protected]' <[email protected]>;
Microsoft Support <[email protected]>
Subject: RE: [MS-SMB2] disconnected PH looses RH lease -
TrackingID#2508130040006291

Hi Slow,

I just wanted to let you know that I've received your traces and I'm currently 
investigating. I will be out of the office until the 2nd of September, but will 
return to my investigation at that time. If an urgent question arises in the 
meantime, please reach out to [email protected].

Thanks for your patience.

Regards,
Kristian Smith
Support Escalation Engineer | Microsoft(r) Corporation
Email: [email protected]

-----Original Message-----
From: Kristian Smith
Sent: Tuesday, August 19, 2025 12:53 PM
To: Ralph Boehme <[email protected]>
Cc: [email protected]; Microsoft Support
<[email protected]>
Subject: RE: [MS-SMB2] disconnected PH looses RH lease -
TrackingID#2508130040006291

Hi Slow,

I'm looking into this issue for you. I think it would be easier to diagnose 
with the network and t.cmd traces. Would you please upload them to the link 
below?

Collect SMB traces with t.cmd and gather WireShark trace
1.    Rename t.txt to t.cmd (file is attached)
2.    Open Command Prompt as Administrator (PowerShell works too, you just need to enter 
the command "cmd" when it opens)
3.    Navigate to the directory of t.cmd
4.    Run "t.cmd srvon"
5.    Start a network trace with WireShark
5.    Reproduce the scenario
6.    End network trace
6.    Run "t.cmd off"
7.    Upload the .cab file and network trace via link provided: 
https://support.microsoft.com/files?workspace=eyJhbGciOiJSUzI1NiIsImtpZCI6IjUwNjQwRTE0NEREODg5MzE5NzYzRTBFNjM5RjMzNjdFQUNDNzlBRDAiLCJ0eXAiOiJKV1QifQ.eyJ3c2lkIjoiOTE5NDM3ODAtNGUxZS00NzllLTk3NDgtMDBkOWNhNmY5MGQ2Iiwic3IiOiIyNTA4MTMwMDQwMDA2MjkxIiwic3YiOiJ2MSIsInJzIjoiRXh0ZXJuYWwiLCJ3dGlkIjoiMzY0ZDM0OWQtMWJiYi00NzYzLTllMTYtYjI1YjYyM2JkMTExIiwiYXBwaWQiOiI0ZTc2ODkxZC04NDUwLTRlNWUtYmUzOC1lYTNiZDZlZjIxZTUiLCJuYmYiOjE3NTU2MzMwMjUsImV4cCI6MTc2MzQwOTAyNCwiaWF0IjoxNzU1NjMzMDI1LCJpc3MiOiJodHRwczovL2FwaS5kdG1uZWJ1bGEubWljcm9zb2Z0LmNvbSIsImF1ZCI6Imh0dHA6Ly9zbWMifQ.fI8Km4wuEKzQV-vlA61yxw1UKkJLSNK4CH7LSRPGpFJw4B_usMsnDfWPj_MD7br6XLh-GLLhtRmAYhCiHcFciAt7pA4gTpFZBZGCpdYdVHCO4v3YVr7tMtLmN6nhtyo8xVpBFor04jA5nzYnSDThqmWZEGxW5Oc4dFqQ_aEfacCYn68KwqxgvqasQjGht9AV_Kdrz8L2oyHd2zgBaxR_Jag1VfF5nDexuJoVRR37kdvvMwCPZq-qZlGaVJtkgwk3t6ZE2lgF8laQOoZVYmwmKRJW1hub_beA6iTKT0EMV0H2XSwZAW9H744hUdnd41OePbzqUs43_IcDLq2mkxM7FQ&wid=91943780-4e1e-479e-9748-00d9ca6f90d6

Let me know if you have any issues collecting the smb trace. Thanks for your 
time.

Regards,
Kristian Smith
Support Escalation Engineer | Microsoft(r) Corporation
Email: [email protected]

-----Original Message-----
From: Kristian Smith
Sent: Wednesday, August 13, 2025 8:36 AM
To: Ralph Boehme <[email protected]>
Cc: [email protected]; Microsoft Support
<[email protected]>
Subject: RE: [MS-SMB2] disconnected PH looses RH lease -
TrackingID#2508130040006291

[DocHelp to Bcc]

Hi Slow,

Thanks again for your Persistent Handle question. I've created case 
2508130040006291 to track the issue. One of our engineers will investigate this 
and reach out to you soon.

Regards,
Kristian Smith
Support Escalation Engineer | Microsoft(r) Corporation
Email: [email protected]

-----Original Message-----
From: Ralph Boehme <[email protected]>
Sent: Wednesday, August 13, 2025 3:33 AM
To: Interoperability Documentation Help <[email protected]>
Cc: [email protected]
Subject: [EXTERNAL] MS-SMB2: disconnected PH looses RH lease

Hello dochelp,

another one... :)

I see the following unexpected behaviour against a Windows server with 
Fileserver for General Use role where a Persistent Handle with lease=RH is 
silently downgraded to NONE:

1. Client 1 opens a file with PH, lease=RH, sharemode=NONE 2. Client 1
disconnects TCP 3. Client 2 wants to open the file for reading, this
fails with STATUS_FILE_NOT_AVAILABLE 4. Client 1 reconnects SMB 5.
Client 1 reconnects PH and in the response the lease state is NONE
(and the epoch is unchanged)

Accoding to "3.3.4.7 Object Store Indicates a Lease Break" it is ok to loose an R lease, but not an 
RH lease, similarly "SMB 2.2 : Bigger, Faster, Scalier (Part 2)", page 50, states breaking from RH 
to none is "illegal".

Can you please clarify?

Traces (pcap + t.cmd) available.

Thanks!
-slow


Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

_______________________________________________
cifs-protocol mailing list
[email protected]
https://lists.samba.org/mailman/listinfo/cifs-protocol

Reply via email to