Bug 12969 - Disconnected durable handles with handle lease
Disconnected durable handles with handle lease
Status: ASSIGNED
Product: Samba 4.1 and newer
Classification: Unclassified
Component: File services
unspecified
All All
: P5 normal
: ---
Assigned To: Ralph Böhme
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-08-16 05:43 UTC by Ralph Böhme
Modified: 2017-08-16 05:43 UTC (History)
0 users

See Also:


Attachments
Reproducer (6.92 KB, patch)
2017-08-16 05:43 UTC, Ralph Böhme
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ralph Böhme 2017-08-16 05:43:05 UTC
Created attachment 13476 [details]
Reproducer

Disconnected durable handles must be preserved in case of a lease break when the "breaking-to" lease state contains SMB2_LEASE_HANDLE_CACHING (MS-SMB2 3.3.4.7 Object Store Indicates a Lease Break).

Attached WIP test verifies this against Windows server 2016. Samba fails the same test, because in share_mode_stale_pid() we ignore share-mode entries of disconnected opens and mark them for removal.

Samba master fails right away:

$ ./bin/smbtorture -U USER //localhost/share smb2.durable-open
...
test 1: Hold RH, requesting R, expecting break to RH and grant of R
failure: reconnect-contended-lease [
../source4/torture/smb2/durable_open.c:2890: status was NT_STATUS_OBJECT_NAME_NOT_FOUND, expected NT_STATUS_OK: smb2_create failed
]

The same test passes against Windows:

$ ./bin/smbtorture -U Administrator //10.10.11.14/share smb2.durable-open
....
test 1: Hold RH, requesting R, expecting break to RH and grant of R
test 2: Hold RH, requesting RH, expecting break to RH and grant of RH
test 3: Hold RH, requesting RW, expecting break to RH and grant of R
...

Working on a fix as part of my persistent handles research.