3.2.5.19.1 Receiving an Oplock Break Notification

The client MUST locate the open in the Session.OpenTable using the FileId in the Oplock Break Notification following the SMB2 header. If the open is not found, the oplock break indication MUST be discarded, and no further processing is required.

If the open is found, the client MUST take action based on the Open.OplockLevel and the new OplockLevel that is received in the Oplock Break Notification.

If the Open.OplockLevel is SMB2_OPLOCK_LEVEL_NONE, no action is required, and no further processing is required.

If the Open.OplockLevel is SMB2_OPLOCK_LEVEL_II, and the OplockLevel is SMB2_OPLOCK_LEVEL_NONE, the client MUST set Open.OplockLevel to SMB2_OPLOCK_LEVEL_NONE.

If the Open.OplockLevel is SMB2_OPLOCK_LEVEL_BATCH, and the OplockLevel is SMB2_OPLOCK_LEVEL_NONE, the client MUST set Open.OplockLevel to SMB2_OPLOCK_LEVEL_NONE. The client MUST flush any writes or byte range locks that it has cached locally to the server. When that is complete, the client MUST send an oplock break acknowledgment, as specified in the following sections.

If the Open.OplockLevel is SMB2_OPLOCK_LEVEL_BATCH, and the OplockLevel is SMB2_OPLOCK_LEVEL_II, the client MUST set Open.OplockLevel to SMB2_OPLOCK_LEVEL_II. The client MUST flush any writes or byte range locks that it has cached locally to the server. When that is complete, the client MUST send an oplock break acknowledgment, specified as follows.

The client MAY<162> choose to request and support SMB2_OPLOCK_LEVEL_EXCLUSIVE. If it does, the break operation would match those specified above for SMB2_OPLOCK_LEVEL_BATCH. It MUST NOT break from batch to exclusive.

If the client is required to send an oplock break acknowledgment, it MUST construct a request following the syntax that is specified in section 2.2.24.1. The SMB2 header is initialized as follows:

  • Command MUST be set to SMB2 OPLOCK_BREAK.

  • The MessageId field is set as specified in section 3.2.4.1.3.

  • The client MUST set SessionId to Open.TreeConnect.Session.SessionId.

  • The client MUST set TreeId to Open.TreeConnect.TreeConnectId.

The Oplock Break Acknowledgment request is initialized as follows:

  • The FileId MUST be set to Open.FileId.

  • The OplockLevel MUST be set to Open.OplockLevel.

The request MUST be sent to the server.

Show: