Current SMB2 leases patchset (WIP).

Jeremy Allison jra at samba.org
Tue Oct 28 16:14:35 MDT 2014


On Tue, Oct 28, 2014 at 10:56:53PM +0100, Stefan (metze) Metzmacher wrote:
> Hi Jeremy,
> 
> Can you split out some of the changes of the first commit, e.g.
> 
> - the ndr_pull_struct_blob_all() change
> - the changes in source3/locking/brlock.c have_read... => num_read...

Sure, I'll do that.

> Why is lease_idx uint16_t? Do we want a limit of not more than UINT16_MAX
> opens per file?

It's an index into an array inside an entry in the share modes tdb.

Could be made into a uint32_t, but that seems a little excessive.

> Calling send_break_message() seems wrong, why should we send
> a lease break to our own client, when the client tries to reuse
> the lease on the current open?
> 
> Does a Windows 10 client behave differntly compared to Windows 7 and 8
> (8.1) ?
>
> We should just set SMB2_LEASE_NONE (and epoch++) in the lease we return.
> This seems to be the correct way to downgrade the lease in this case
> in an create response.

Haven't tested Windows 10, only 7 & 8 and the code is working
well here (at at Mathworks too).

This is actually unclear as we don't have a good way of viewing the
state of the client redirector cache. I've had multiple conversations
with Microsoft engineers on this, and they recommended sending the
breaks (without waiting) and then responding to the open, so that's
what the code does.

I don't think sending the breaks in this case will hurt, and once
we get the break responses we actually do know that the state of
the client redirector cache is good.

Can you see a good way of passing this state down into the
CREATE_FILE vfs call so we can be sure to increment the epoch ?

> More comments later...

Thanks !

Jeremy.


More information about the samba-technical mailing list