Bug 15651 - Durable handle is granted but reconnect fails
Summary: Durable handle is granted but reconnect fails
Status: NEW
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: File services (show other bugs)
Version: 4.20.1
Hardware: All All
: P5 major (vote)
Target Milestone: ---
Assignee: Samba QA Contact
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-28 17:30 UTC by Sandeep Kanyal
Modified: 2024-05-28 20:19 UTC (History)
2 users (show)

See Also:


Attachments
Contains packet traces & a synthetic client to repro the issue (367.00 KB, application/x-gzip)
2024-05-28 17:30 UTC, Sandeep Kanyal
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sandeep Kanyal 2024-05-28 17:30:26 UTC
Created attachment 18303 [details]
Contains packet traces & a synthetic client to repro the issue

Scenario:

1) Client sends open1 with OpLock lease & requests for Durable Handle
2) Open1 Succeeds & Durable Handle is granted
3) Client sends another open2 for same file with OpLock lease & requests for Durable Handle
4) Open2 Succeeds & Durable Handle is granted

**** Disconnect*****

5) Client Reconnects to DH granted to open1
6) Succeeds
7) Client Reconnects to DH granted to open2
8) Fails with FILE_NOT_FOUND

I debugged it briefly & saw that when Disconnect happens, the open2 is freed from smbXsrv_open_global. And then when request #7 lands on samba server, we don't find the open handle & fail the request. 

Tried the same scenario against a windows server & it works fine (Traces attached).

P.S: The packets attached is just a representation of the bug using a synthetic client. I'm hitting this bug while using a Microsoft tool to dump the data after 10+ hours over a slow network (GBs of traces, so cant attach that here & attaching only the relevant packets to repro the issue)
Comment 1 Ralph Böhme 2024-05-28 20:18:53 UTC
This is a known (since a few weeks) deficiency in Samba's DH code that was built on the assumption that the spec would mandata to only ever allow one DH per file. This is apparently wrong. Carefully crafted fixes plus tests are highly welcome!