Patch: Implement FSCTL_LMR_REQUEST_RESILIENCY

Michael Adam obnox at samba.org
Thu Oct 9 01:10:35 MDT 2014


On 2014-10-08 at 20:46 -0700, Richard Sharpe wrote:
> On Wed, Oct 8, 2014 at 8:40 AM, Michael Adam <obnox at samba.org> wrote:
> > On 2014-10-08 at 08:21 -0700, Richard Sharpe wrote:
> >> On Wed, Oct 8, 2014 at 8:02 AM, Michael Adam <obnox at samba.org> wrote:
> >> > On 2014-10-08 at 07:29 -0700, Richard Sharpe wrote:
> >> >>
> >> >> There are indications that HyperV requires the server to implement
> >> >> FSCTL_LMR_REQUEST_RESILIENCY, so I have a proposed implementation of
> >> >> it.
> >> >
> >> > I expect that persistent handles will also be sufficient.
> >>
> >> It's not. I have a capture against master where a resilient handle is
> >> requested and responded to, but HyperV fails when it tries to request
> >> a change in the resiliency period.
> >
> > Sure. My point is was that Hyper-V would not be requesting
> > reslient handles if it could even get persistent ones.
> > Against Samba, the hyper-v requests resiliency because it
> > could not get a persistent handle.
> 
> This seems incorrect. I have a capture of Windows to Windows and it
> also has a DH2Q Extra Create Parameter in the CREATE request, the same
> as it submits to Samba.

The mere presence/use of DH2Q per se does not imply anything
apart from durable handles. It is just that DH2Q is used
instead of DHNQ if the negotiated protocol version is >= 3.0.

DH2Q offers the possibility to request (and grant) persistent
handles, by virtue of the persistent flag in the flags field.
The server will only give out persistent handles if the
corresponding capability is announced and the accessed share is
a CA (continuously available) share. Otherwise, DH2Q is just
used to request and grant durable handles.

So if you want to verify or falsify my statement, you'd need to
connect to a CA share on a server supporting persistent handles
and then see whether hyper-v still requests resiliency if it
has got persistent handles. The rationale is that the preferred
SMB share to run hyper-v off is a CA (and Scale-out) SMB3 cluster share.

> >> OK, so there is more work to do. Why do we need to keep the file open
> >> at the UNIX level? Surely it is the same to open it again when the
> >> client sends a D2NC or whatever.
> >
> > We don't strictly need to keep the unix file open
> > (as proven by the implementation of durables),
> > but this would make several things easier.
> > In particular, only this way we would have a chance
> > to notice when a non-samba-process tries to access
> > the file.
> 
> Ahhh, OK. In this case that is not needed.

Right, it is not needed (except if you want interop),
but I'd still say it is generally better to keep it open
if possible. Makes life easier.

Cheers - Michael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20141009/fe420dd3/attachment.pgp>


More information about the samba-technical mailing list