Work on SMB3 persistent handles

Ralph Böhme slow at samba.org
Thu Oct 26 17:27:20 UTC 2017


Hi folks,

On Wed, Oct 25, 2017 at 04:09:21PM +0000, Albert Guo via samba-technical wrote:
> I made a POC based on your git repository with some hack.  This is test I did:
> 1.	Copy a large file to a CA enabled share from Windows 2012 R2 client
> 2.	Restart Samba daemons
> The persistent file handle is reconnected successfully, and the file copy
> continues without any error.

hooray! :)

Fwiw I've been exploring the design space for fur in my spare time and also took
some notes on possible designs for the persistent storage layer and APIs. You
can find my current design doc here:

git branch: <https://git.samba.org/?p=slow/samba.git;a=shortlog;h=refs/heads/persistent-handles>
git commit: <https://git.samba.org/?p=slow/samba.git;a=commitdiff;h=164ae1364fbe250f2da87a53aa7e571d6548d93f>
as txt: <https://git.samba.org/?p=slow/samba.git;a=blob_plain;f=STEPS.txt;h=cee0f64c69811698679b0bf131db526549f3dd53;hb=164ae1364fbe250f2da87a53aa7e571d6548d93f>
as html: <https://www.samba.org/~slow/STEPS.html>

The links are a bit broken in the text version.

The branch also has a bunch of torture tests for various aspects of persistent
handles as well as some wip patches for the SMB2 frontend and the FSA
subsystems. But most of that stuff is more akind of taking notes. Some stuff is
from going through the Simplivity patchset (see below) and splitting it up into
microcommits [1].

For the storage backend I'm currently leaning towards the "2.1.2 New database
for persistent handles" design and will start prototyping in my spare time. I'm
only making slow progress as there's just too much other stuff that wants my
attention. :)

> The purpose of the POC is to identify the gaps we have for supporting persistent file handles.

For upstream we mostly needed a proper storage layer that also works in the
clustered case.

One important thing that may not be obvious is that you have to protect
disconnected persistent handles from contenting opens, cf MS-SMB2 3.3.5.9 and
3.3.4.7. Though the latter is currently incomplete and will be updated my MS in
the future explaining how to deal with lease breaks and disconnected PHs. I can
share the details if you like, I haven't yet added this to my design doc
neither.

> I attached my patch in the attachment. The patch is very simple:
>
> 1. Remove TDB_CLEAR_IF_FIRST from open path of locking.tdb and
>    smbXsrv_open_global.tdb

Without adding transactions this has the risk of corrupting the databases in the
event of a crash. Adding transcations has performance implications. Iirc patches
for persistent handles were submitted to the mailing list, directly or
indirectly, at least once. I have a munged version of the persistent handle
patchset from Simplivity here:

<https://git.samba.org/?p=slow/samba.git;a=shortlog;h=refs/heads/persistent-simplivity>

Hth!

-slow

[1] <https://git.samba.org/?p=slow/samba.git;a=shortlog;h=refs/heads/persistent-simplivity-steps>

-- 
Ralph Boehme, Samba Team       https://samba.org/
Samba Developer, SerNet GmbH   https://sernet.de/en/samba/



More information about the samba-technical mailing list