[cifs-protocol] [EXTERNAL] MS-SMB2: Reconnect of second disconnected PH on a file fails if contending open broke H lease - TrackingID#2509250040006209
Obaid Farooqi
obaidf at microsoft.com
Tue Oct 21 21:29:53 UTC 2025
abc at DESKTOP-0F1ASDC:~/slow/samba$ git log --oneline -12
3c97c904 (HEAD -> slow/ph-for-obaid, origin/ph-not-found-bug, ph-not-found-bug) Revert "wip"
4505a2bf wip
885c66eb smbstatus: avoid a crash with --json output if the access_mask has SEC_STD_WRITE_OWNER
a7948dc6 smbtorture: add test "smb2.persistent-open.replay-multi"
d669b7a8 smbtorture: add test "smb2.persistent-open.replay-reconnect"
05c2d8ff smbtorture: add test "smb2.persistent-open.rename-dir-open-files"
d03f9eff smbtorture: add test "smb2.persistent-open.timeout_5" and "smb2.persistent-timeout"
3e1fce0e smbtorture: add test "smb2.persistent-open.reconnect-contended-replay"
99524f06 TODO Windows is broken / smbtorture: add test "smb2.persistent-open.reconnect-contended-oplock"
b6e4f727 smbtorture: add test "smb2.persistent-open.reconnect-contended"
63ad9c37 smbtorture: start of a smb2.persistent-open testsuite
792b3dca smbtorture: correctly handle scale-out shares in test_one_durable_v2_open_oplock()
abc at DESKTOP-0F1ASDC:~/slow/samba$
Regards,
Obaid Farooqi
Sr. Escalation Engineer | Microsoft
-----Original Message-----
From: Ralph Boehme <slow at samba.org>
Sent: Tuesday, October 21, 2025 12:48 AM
To: Obaid Farooqi <obaidf at microsoft.com>
Cc: cifs-protocol at lists.samba.org; Microsoft Support <supportmail at microsoft.com>
Subject: Re: [EXTERNAL] MS-SMB2: Reconnect of second disconnected PH on a file fails if contending open broke H lease - TrackingID#2509250040006209
Hi Obaid,
ah, sorry, I misinterpreted the command output.
The test should be there in that branch. If it's not I wonder whether you checked out the wrong branch or wrong commit.
What shows:
$ git log --oneline -12
Here I see:
slow at inti:scratch7 ▸ git log --oneline -12
ea344a5fb3f9 (HEAD, gitlab/slow/ph-tests, gitlab/slow/ph-for-obaid) !fixup ctdb push_record.hdr.rsn-- 2dfe40ac6e3f smbXsrvdump: ignore unparsable records d250eeae999a smbtorture: fix a test rundown
6a334d581809 WIP smbtorture: add test
"smb2.persistent-open.directory-disconnect"
fae2fa6fa02b smbtorture: add test
"smb2.persistent-open.directory-leaselevels"
ed70f20345df smbtorture: add test "smb2.persistent-open.replay-multi"
79682bddfc03 smbtorture: add test "smb2.persistent-open.replay-reconnect"
1f6aea0aecec smbtorture: add test
"smb2.persistent-open.rename-dir-open-files"
9f0098887662 smbtorture: add test "smb2.persistent-open.timeout_5" and "smb2.persistent-timeout"
5f3267b1ae72 smbtorture: add test
"smb2.persistent-open.reconnect-contended-replay"
c2dcaba061cd smbtorture: add test
"smb2.persistent-open.reconnect-contended-oplock"
a6b7389217a0 smbtorture: add test
"smb2.persistent-open.reconnect-contended-two"
The commit at the bottom is the one with the test in question.
On 10/20/25 11:18 PM, Obaid Farooqi wrote:
> Hi Ralph:
> I can actually run smbtorture test cases and has been doing so for couple of months now.
> The test case smb2.persistent-open.reconnect-contended-two does not seem to exist (at least it should be listed in smbtorture --list command. Not?).
>
> Anyway, I did run the two command you sent, and I still cannot run
> this particular test case. I can run other test cases like the
> following
>
>
> abc at DESKTOP-0F1ASDC:~/slow/samba$ ./bin/smbtorture
> //192.168.1.200/smbclustered -Ucontoso/administrator%Password01!
> smb2.persistent-open.reconnect-contended --option=torture:single=yes
> --option=torture:subtest=109 smbtorture 4.24.0pre1-DEVELOPERBUILD
> Using seed 1760993246
> time: 2025-10-20 20:47:26.788907
> test: reconnect-contended
> time: 2025-10-20 20:47:26.789455
> 109: Hold [RWH] with sharemode [R ]. Contend with access [13019F] lease [RWH]. Expecting break to [RW ] by new open with [ ] lease and result [NT_STATUS_SHARING_VIOLATION]
> Waiting for a potential lease break...
> transport[0x55adba249e20] acking to 0x5 (RW) in lease handler Got 1
> lease breaks Waiting for a potential lease break...
> ... waiting for a lease break timed out Waiting for a potential lease
> break...
> ... waiting for a lease break timed out transport[0x55adba249e20]
> acking to 0x1 (R) in lease handler transport[0x55adba249e20] received
> to 0x0 () in lease handler
> time: 2025-10-20 20:47:51.147942
> success: reconnect-contended
> abc at DESKTOP-0F1ASDC:~/slow/samba$
>
> Regards,
> Obaid Farooqi
> Sr. Escalation Engineer | Microsoft
>
> -----Original Message-----
> From: Ralph Boehme <slow at samba.org>
> Sent: Monday, October 20, 2025 2:28 PM
> To: Obaid Farooqi <obaidf at microsoft.com>
> Cc: cifs-protocol at lists.samba.org; Microsoft Support
> <supportmail at microsoft.com>
> Subject: Re: [EXTERNAL] MS-SMB2: Reconnect of second disconnected PH
> on a file fails if contending open broke H lease -
> TrackingID#2509250040006209
>
> Hi Obaid,
>
> can you please try:
>
> $ sudo mkdir -p /usr/local/samba/etc/
> $ sudo touch /usr/local/samba/etc/smb.conf
>
> Btw, user option -U should \ to seperate domain and username and if
> the passwort contains special characters like ! you have to encluse it
> in '', eg
>
> -U 'contoso\administrator%Password01!'
>
>
> On 10/20/25 9:08 PM, Obaid Farooqi wrote:
>> Hi Ralph:
>> Thanks for the instructions. I was able to fetch and checkout the branch but cannot run the testcase. I am using the following command:
>>
>> $ bin/smbtorture -d 0 -U 'USER%PASSWORD' //SERVER/SHARE
>> smb2.persistent-open.reconnect-contended-two
>> --option=torture:single=yes --option=torture:subtest=17
>>
>> abc at DESKTOP-0F1ASDC:~/slow/samba$ ./bin/smbtorture
>> //192.168.1.200/smbclustered -Ucontoso/administrator%Password01! -d 0
>> smb2.persistent-open.reconnect-contended-two
>> --option=torture:single=yes --option=torture:subtest=17 smbtorture
>> 4.24.0pre1-DEVELOPERBUILD Can't load /usr/local/samba/etc/smb.conf -
>> run testparm to debug it Using seed 1760987220
>> time: 2025-10-20 19:07:00.543647
>> Unknown torture operation 'smb2.persistent-open.reconnect-contended-two'
>>
>>
>>
>> I checked and the test case does not exist.
>>
>> abc at DESKTOP-0F1ASDC:~/slow/samba$ git branch
>> ph-not-found-bug
>> * slow/ph-for-obaid
>> abc at DESKTOP-0F1ASDC:~/slow/samba$ ./bin/smbtorture --list | grep -i
>> smb2.persistent Can't load /usr/local/samba/etc/smb.conf - run
>> testparm to debug it
>> smb2.persistent-open.reconnect-lease.reconnect-lease
>> smb2.persistent-open.reconnect-contended.reconnect-contended
>> smb2.persistent-open.reconnect-contended-oplock.reconnect-contended-o
>> p
>> lock
>> smb2.persistent-open.reconnect-contended-replay.reconnect-contended-r
>> e
>> play
>> smb2.persistent-open.timeout_5.timeout_5
>> smb2.persistent-open.rename-dir-open-files.rename-dir-open-files
>> smb2.persistent-open.replay-reconnect.replay-reconnect
>> smb2.persistent-open.replay-multi.replay-multi
>> smb2.persistent-timeout.timeout_0.timeout_0
>> smb2.persistent-timeout.timeout_299.timeout_299
>> smb2.persistent-timeout.timeout_301.timeout_301
>> smb2.persistent-timeout.timeout_301.timeout_301
>> abc at DESKTOP-0F1ASDC:~/slow/samba$
>>
>> Regards,
>> Obaid Farooqi
>> Sr. Escalation Engineer | Microsoft
>>
>> -----Original Message-----
>> From: Ralph Boehme <slow at samba.org>
>> Sent: Monday, October 20, 2025 11:31 AM
>> To: Obaid Farooqi <obaidf at microsoft.com>
>> Cc: cifs-protocol at lists.samba.org; Microsoft Support
>> <supportmail at microsoft.com>
>> Subject: Re: [EXTERNAL] MS-SMB2: Reconnect of second disconnected PH
>> on a file fails if contending open broke H lease -
>> TrackingID#2509250040006209
>>
>> Hi Obaid
>>
>> sorry, the below command requires a gitlab account, you can use https
>> instead:
>>
>> $ git fetch https://gitlab.com/samba-team/devel/samba.git slow/ph-for-obaid ...
>> $ git checkout -b slow/ph-for-obaid FETCH_HEAD ...
>>
>> I've created a seperate more stable branch "ph-for-obaid" because "ph-testes" is still in flux and may be unstable.
>>
>> Let me know if this works.
>>
>> -Ralph
>>
>> On 10/13/25 4:19 AM, Obaid Farooqi wrote:
>>> Hi Ralph:
>>> The following command does not work. Here is what I see when executing these commands:
>>>
>>> abc at DESKTOP-0F1ASDC:~/slow/samba$ git fetch "git at gitlab.com:samba-team/devel/samba.git" 'slow/ph-tests'
>>> git at gitlab.com: Permission denied (publickey).
>>> fatal: Could not read from remote repository.
>>>
>>> Please make sure you have the correct access rights and the
>>> repository exists.
>>> abc at DESKTOP-0F1ASDC:~/slow/samba$
>>>
>>> Regards,
>>> Obaid Farooqi
>>> Sr. Escalation Engineer | Microsoft
>>>
>>> -----Original Message-----
>>> From: Ralph Boehme <slow at samba.org>
>>> Sent: Monday, October 6, 2025 5:26 AM
>>> To: Obaid Farooqi <obaidf at microsoft.com>
>>> Cc: cifs-protocol at lists.samba.org; Microsoft Support
>>> <supportmail at microsoft.com>
>>> Subject: Re: [EXTERNAL] MS-SMB2: Reconnect of second disconnected PH
>>> on a file fails if contending open broke H lease -
>>> TrackingID#2509250040006209
>>>
>>> Hi Obaid,
>>>
>>> https://gitlab.com/samba-team/samba/-/merge_requests/4188
>>>
>>> $ git fetch "git at gitlab.com:samba-team/devel/samba.git" 'slow/ph-tests'
>>> $ git checkout -b 'samba-slow/ph-tests' FETCH_HEAD
>>>
>>> The test:
>>>
>>> $ bin/smbtorture -d 0 -U 'USER%PASSWORD' //SERVER/SHARE
>>> smb2.persistent-open.reconnect-contended-two
>>> --option=torture:single=yes
>>> --option=torture:subtest=17
>>>
>>> Server must be Fileserver-For-General-Use.
>>>
>>> Thanks!
>>>
>>> On 10/4/25 12:36 AM, Obaid Farooqi wrote:
>>>> Hi Ralph:
>>>> Is this one of the PH test cases that I can run?
>>>> Please let me know the test case # and, also upload a network capture of this scenario to the following link:
>>>>
>>>>
>>>> https://support.microsoft.com/files?workspace=eyJhbGciOiJSUzI1NiIsI
>>>> m
>>>> t
>>>> p
>>>> ZCI6IjJBNzk1QUQxMDNDQTM4OEZENEQzREQxQTZERkU4QTE2RDkyMkNDQkMiLCJ0eXA
>>>> i
>>>> O
>>>> i
>>>> JKV1QifQ.eyJ3c2lkIjoiNzUzYTIwMzktY2Q3OS00ZWZjLTg0YmYtZTIyYzIzZDQyNz
>>>> E
>>>> 2
>>>> I
>>>> iwic3IiOiIyNTA5MjUwMDQwMDA2MjA5Iiwic3YiOiJ2MSIsInJzIjoiRXh0ZXJuYWwi
>>>> L
>>>> C
>>>> J
>>>> 3dGlkIjoiNjRhMzY4NTMtNjdmYS00NWQ3LTg5NjItMjc0ZGZiZGViYWRhIiwiYXBwaW
>>>> Q
>>>> i
>>>> O
>>>> iI0ZTc2ODkxZC04NDUwLTRlNWUtYmUzOC1lYTNiZDZlZjIxZTUiLCJuYmYiOjE3NTk1
>>>> M
>>>> z
>>>> A
>>>> 4OTYsImV4cCI6MTc2NzMwNjg5NSwiaWF0IjoxNzU5NTMwODk2LCJpc3MiOiJodHRwcz
>>>> o
>>>> v
>>>> L
>>>> 2FwaS5kdG1uZWJ1bGEubWljcm9zb2Z0LmNvbSIsImF1ZCI6Imh0dHA6Ly9zbWMifQ.J
>>>> 0
>>>> g
>>>> P
>>>> 8LIQEThWlwlLlFsh6XIgtWNkc4vnRFxWjaVFXmmWzFbkUXuT647F4sRMgnYP6CWx27w
>>>> e
>>>> u
>>>> Z
>>>> 9Vo7LdUqS1lupAXlJBeHlzq5sEsvA8Xl1H_gsLrGMJROpJl1aE9GUBzjrypWjB6wI0W
>>>> Z
>>>> c
>>>> 9
>>>> 9JuiQ3eEW9-aVlauQOziwvzm_5DYd8SQ9Cje91qnBhR2Zoy7wwK3laKh_-WtCHe1xkW
>>>> C
>>>> u
>>>> X
>>>> V7ywV2tSwdvnPrCJLiQObWZxailC1xgaRQ9gvSL1_PAqCfT98bOkuCPdX6VlJ5Va7Dp
>>>> B
>>>> P
>>>> d
>>>> 24dZCdUlJxjOs12pwgcTP1Ibz_G0DrxMqr7-VUI62XhfktAQIzABLgYnwg&wid=753a
>>>> 2
>>>> 0
>>>> 3
>>>> 9-cd79-4efc-84bf-e22c23d42716
>>>>
>>>> Regards,
>>>> Obaid Farooqi
>>>> Sr. Escalation Engineer | Microsoft
>>>>
>>>> -----Original Message-----
>>>> From: Michael Bowen <Mike.Bowen at microsoft.com>
>>>> Sent: Thursday, September 25, 2025 10:07 AM
>>>> To: Ralph Boehme <slow at samba.org>
>>>> Cc: cifs-protocol at lists.samba.org; Microsoft Support
>>>> <supportmail at microsoft.com>
>>>> Subject: RE: [EXTERNAL] MS-SMB2: Reconnect of second disconnected
>>>> PH on a file fails if contending open broke H lease -
>>>> TrackingID#2509250040006209
>>>>
>>>> Hi Ralph,
>>>>
>>>> Thanks for your question. I've created case number 2509250040006209to track this issue. Please leave the number in the subject line and use reply all your correspondence. One of our engineers will contact you soon.
>>>>
>>>> Best regards,
>>>> Michael Bowen
>>>> Sr. Escalation Engineer - Microsoft® Corporation
>>>>
>>>>
>>>>
>>>> -----Original Message-----
>>>> From: Ralph Boehme <slow at samba.org>
>>>> Sent: Thursday, September 25, 2025 7:46 AM
>>>> To: Interoperability Documentation Help <dochelp at microsoft.com>
>>>> Cc: cifs-protocol at lists.samba.org
>>>> Subject: [EXTERNAL] MS-SMB2: Reconnect of second disconnected PH on
>>>> a file fails if contending open broke H lease
>>>>
>>>> Hi dochelp!
>>>>
>>>> I'm sorry, but I just ran into another issue I fail to understand...
>>>> :)
>>>>
>>>> Scenario:
>>>>
>>>> Reconnect of second disconnected PH on a file fails if contending open caused a break of the H lease.
>>>>
>>>> Server: Windows 2025, Fileserver for General Use
>>>> Client: smbtorture
>>>>
>>>> CG := Create Guid
>>>> LK := Lease Key
>>>>
>>>> 1. Client 1: open file with PH, lease=RWH, LK=X, CG=Y 2. Client 1:
>>>> another open on the same file with PH, lease=RWH, LK=X, CG=Z (same
>>>> LK as in 1) 3. Disconnect 4. Client 2: content disconnected handles
>>>> with another open that triggers a break and is suspended 5. Client
>>>> 1 reconnects 6. Client 1 reconnects first PH 7. Server sends lease
>>>> break for LK=X to NONE to client 1 8. Client 1 acks lease break 9.
>>>> Client 1 attempts to reconnect second PH but this fails with
>>>> STATUS_FILE_NOT_AVAILABLE
>>>>
>>>> In my understanding 9 should not fail and in my implementation of PH in Samba it succeeds.
>>>>
>>>> Am I missing anything in the docs why 9 should fail?
>>>>
>>>> In my testing with various lease levels and different sharemodes and access masks of the contending open, the pattern seems to be that the second reconnect alway fails if the contending open triggered a H lease break.
>>>>
>>>> Thanks!
>>>> -slow
>>>>
>>>
>>
>
More information about the cifs-protocol
mailing list