Compartir a través de


3.3.5.22.1 Processing an Oplock Acknowledgment

The server MUST locate the session, as specified in section 3.3.5.2.9.

The server MUST locate the tree connection, as specified in section 3.3.5.2.11.

Next, the server MUST locate the open on which the client is acknowledging an oplock break by performing a lookup in Session.OpenTable using FileId.Volatile of the request as the lookup key. If no open is found, or if Open.DurableFileId is not equal to FileId.Persistent, the server MUST fail the request with STATUS_FILE_CLOSED. Otherwise, the server MUST locate the Request in Connection.RequestList for which Request.MessageId matches the MessageId value in the SMB2 header, and set Request.Open to the Open.

If Open.IsPersistent is FALSE and Open.IsReplayEligible is TRUE, the server MUST set Open.IsReplayEligible to FALSE.

If Open.OplockState is not Breaking, the server MUST stop processing the acknowledgment, and send an error response with STATUS_INVALID_DEVICE_STATE.

If the OplockLevel in the acknowledgment is SMB2_OPLOCK_LEVEL_LEASE, the server MUST complete the oplock break request received from the object store as described in section 3.3.4.6, with a new level SMB2_OPLOCK_LEVEL_NONE in an implementation-specific manner,<434> and set Open.OplockLevel to SMB2_OPLOCK_LEVEL_NONE, and Open.OplockState to None, send an error response with STATUS_INVALID_PARAMETER and stop processing.

If any of the following conditions is TRUE, the server MUST complete the oplock break request received from the object store, as described in section 3.3.4.6, with a new level SMB2_OPLOCK_LEVEL_NONE in an implementation-specific manner<435>, set Open.OplockLevel to SMB2_OPLOCK_LEVEL_NONE and Open.OplockState to None, send an error response with STATUS_INVALID_OPLOCK_PROTOCOL, and stop processing:

  • If Open.OplockLevel is SMB2_OPLOCK_LEVEL_EXCLUSIVE, and if OplockLevel is not SMB2_OPLOCK_LEVEL_II or SMB2_OPLOCK_LEVEL_NONE.

  • If Open.OplockLevel is SMB2_OPLOCK_LEVEL_BATCH and if OplockLevel is not SMB2_OPLOCK_LEVEL_II, or SMB2_OPLOCK_LEVEL_NONE, or SMB2_OPLOCK_LEVEL_EXCLUSIVE.

  • If Open.OplockLevel is SMB2_OPLOCK_LEVEL_II, and OplockLevel is not SMB2_OPLOCK_LEVEL_NONE.

If OplockLevel is SMB2_OPLOCK_LEVEL_EXCLUSIVE, the server MUST complete the oplock break request received from the object store as described in section 3.3.4.6, with a new level SMB2_OPLOCK_LEVEL_NONE in an implementation-specific manner.<436>

If OplockLevel is SMB2_OPLOCK_LEVEL_II or SMB2_OPLOCK_LEVEL_NONE, the server MUST complete the oplock break request received from the object store as described in section 3.3.4.6, with a new level received in OplockLevel in an implementation-specific manner.<437>

If the object store indicates an error, the server MUST set the Open.OplockLevel to SMB2_OPLOCK_LEVEL_NONE, the Open.OplockState to None, send the error response with the error code received, and stop processing.

If the object store indicates success, the server MUST update Open.OplockLevel and Open.OplockState as follows:

  • If OplockLevel is SMB2_OPLOCK_LEVEL_EXCLUSIVE, set Open.OplockLevel to SMB2_OPLOCK_LEVEL_NONE and Open.OplockState to None.

  • If OplockLevel is SMB2_OPLOCK_LEVEL_II, set Open.OplockLevel to SMB2_OPLOCK_LEVEL_II and Open.OplockState to Held.

  • If OplockLevel is SMB2_OPLOCK_LEVEL_NONE, set Open.OplockLevel to SMB2_OPLOCK_LEVEL_NONE and the Open.OplockState to None.

The server then MUST construct an oplock break response using the syntax specified in section 2.2.25.1 with the following value:

  • OplockLevel MUST be set to Open.OplockLevel.

This response MUST then be sent to the client.

The status code returned by this operation MUST be one of those defined in [MS-ERREF]. Common status codes returned by this operation include:

  • STATUS_ACCESS_DENIED

  • STATUS_FILE_CLOSED

  • STATUS_INVALID_OPLOCK_PROTOCOL

  • STATUS_INVALID_PARAMETER

  • STATUS_INVALID_DEVICE_STATE

  • STATUS_NETWORK_NAME_DELETED

  • STATUS_USER_SESSION_DELETED