Best practices: Adding Persistent Handle support

Stefan Metzmacher metze at
Fri Jun 2 11:57:23 UTC 2017

Am 02.06.2017 um 13:45 schrieb Stefan Metzmacher via samba-technical:
> Hi Chris,
>> I'm working on Persistent (and Durable) handles.  For Persistent handles, I
>> need to enable a connection-level capability plus a share-level capability.
>> It seems (to me) that I should add a per-share configuration variable that
>> indicates that the specified share supports Continuous Availability (CA;
>> Persistent Handles).
>> My other thought, however, is this:
>> - I am implementing CA using a VFS module.  I believe that this is a valid
>>   approach, because it allows us to adapt to whatever underlying mechanism
>>   the file system might support on its own.
>> - We can also write a "generic" Persistent Handle VFS module that works
>>   with whatever mechanism Martin and Amitay develop.
> The core smbd engine needs to have support for persistent handles first.
> There're 3 layers:
> - the top level one:
>   That has all the mappings from wire to the internal state
>   see smbXsrv_open and smbXsrv_open_global0. I guess these
>   will always be maintained by the core smbd logic, so
>   we need a way to distribute these persistent to all nodes
>   in a cluster or across smbd restarts on a non-clustered server.
> - a glue layer:
>   This maintains the locking.tdb, brlock.tdb, lease_db.tdb,
>   in theory this can be moved behind the vfs layer, but
>   it would require a lot of work. So the core smbd layer
>   need to keep them persistent.
> - the filesystem layer:
>   This maintains the file descriptor (from the kernel or a userspace
>   filesystem) and the kernel oplocks, kernel share modes and posix
>   locks. This is hidden behind the VFS and the VFS module
>   needs to keep them persistent.

Here we would need
with some more options, so they can be used to implement durable,
resilient and persistent handles.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the samba-technical mailing list