Current SMB2 leases patchset (WIP).

Stefan (metze) Metzmacher metze at samba.org
Tue Oct 28 15:56:53 MDT 2014


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...

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

> +			send_break_message(conn->sconn->msg_ctx, e,
> +					SMB2_LEASE_NONE);
> +
> +			/*
> +			 * Windows 7 and 8 lease clients
> +			 * are broken in that they will not
> +			 * respond to lease break requests
> +			 * whilst waiting for an outstanding
> +			 * open request on that lease handle
> +			 * on the same TCP connection, due
> +			 * to holding an internal inode lock.
> +			 *
> +			 * This means we can't reschedule
> +			 * ourselves here, but must return
> +			 * from the create.
> +			 *
> +			 * Work around:
> +			 *
> +			 * Send the breaks and then return
> +			 * SMB2_LEASE_NONE in the lease handle
> +			 * to cause them to acknowledge the
> +			 * lease break. Consulatation with
> +			 * Microsoft engineering confirmed
> +			 * this approach is safe.
> +			 */
> +		}

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.

More comments later...

metze

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20141028/f2557c8e/attachment.pgp>


More information about the samba-technical mailing list