3.3.4.7 Object Store Indicates a Lease Break

The underlying object store indicates the breaking of a lease by specifying the ClientGuid, the ClientLeaseId, and the new lease state. The new lease state MUST be one of NONE, R, RW, and RH.

When the underlying object store indicates the lease break, the server MUST locate the Lease Table by performing a lookup in GlobalLeaseTableList using the provided ClientGuid as the lookup key, and then locate the Lease entry by performing a lookup in the LeaseTable.LeaseList using the provided ClientLeaseId as the lookup key.

If no entry is found, the server MUST NOT generate a Lease Break Notification. Instead, the server MUST complete the lease break call from the underlying object store with "NONE" as the new lease state, and take no further action.

If a lease entry is found, the server MUST check the state of Open.Connection for all Opens in Lease.LeaseOpens. If Open.Session.Connection.Dialect belongs to the SMB 3.x dialect family and Open.Connection is NULL, the server MUST select an alternate connection in Open.Session.ChannelList and update Open.Connection.

If Open.Connection is NULL, Open.IsResilient is FALSE and Open.IsPersistent is FALSE, the server MUST close the Open as specified in section 3.3.4.17 for the following cases:

  • Open.IsDurable is FALSE.

  • Lease.BreakToLeaseState does not contain SMB2_LEASE_HANDLE_CACHING and Open.IsDurable is TRUE.

If Lease.LeaseOpens is empty, the server MUST NOT generate a Lease Break Notification. Instead, the server MUST complete the lease break call from the underlying object store with "NONE" as the new lease state, set Lease.LeaseState to "NONE", and take no further action.

If Lease.LeaseOpens is not empty, the server MUST construct a Lease Break Notification (section 2.2.23.2) message to send to the client. The server MUST set the Command in the SMB2 header to SMB2 OPLOCK_BREAK, and the MessageId to 0xFFFFFFFFFFFFFFFF. The server MUST set the SessionId and TreeId in the SMB2 header to 0. If Lease.LeaseState is SMB2_LEASE_READ_CACHING, the server MUST set the Flags field of the message to zero and MUST set Open.OplockState to None for all opens in Lease.LeaseOpens. The server MUST set Lease.Breaking to FALSE, and the LeaseKey field MUST be set to Lease.LeaseKey. Otherwise the server MUST set the Flags field of the message to SMB2_NOTIFY_BREAK_LEASE_FLAG_ACK_REQUIRED, indicating to the client that lease acknowledgment is required. The LeaseKey field MUST be set to Lease.LeaseKey. The server MUST set Open.OplockState to Breaking for all opens in Lease.LeaseOpens. The server MUST set the CurrentLeaseState field of the message to Lease.LeaseState, set Lease.Breaking to TRUE, set Lease.BreakToLeaseState to the new lease state indicated by the object store, and set Lease.LeaseBreakTimeout to the current time plus an implementation-specific default value in milliseconds.<200> If the server implements the SMB 3.x dialect family and Lease.Version is 2, the server MUST set NewEpoch to Lease.Epoch + 1. Otherwise, NewEpoch MUST be set to zero.

The SMB2 Lease Break Notification is sent to the client using the connection specified in Open.Connection of the first Open in Lease.LeaseOpens. The message SHOULD NOT be signed. The server MUST start the oplock break acknowledgment timer as specified in 3.3.2.1. If there was an error in attempting to transmit the message to the client, the server MUST retry the send using the connection specified in Open.Connection of the next open in Lease.LeaseOpens. If the server fails to send transmit the message on any Open.Connection associated with this lease, the server MUST complete the lease break call from the underlying object store with "NONE" as the new lease state.

Show: