3.2.5.4 Receiving a Write Request

When the server receives a write request, the server MUST locate the Open in the OpenTable where Open.LocalOpen matches the Open provided by the SMB2 server, as specified in [MS-SMB2] section 3.3.5.13.

If no Open is found, the server MUST fail the request with the STATUS_INVALID_PARAMETER error code.

If the Open is found, Open.IsVirtualSCSIDisk is true, and Open.InitiatorId is zero, the server MUST process as follows:

  • If Open.SenseErrorSequence is 0xFF, the server MUST reset Open.SenseErrorSequence to 0x00. Otherwise, the server MUST increment the Open.SenseErrorSequence by 0x01.

  • The server MUST update SenseError in Open.SenseErrorDataList at index Open.SenseErrorSequence as follows:

    • SenseError.StatusKey MUST be set to Open.SenseErrorSequence.

    • Update other fields of SenseError with an implementation-specific<14> value.

  • The server MUST return the error (STATUS_SVHDX_ERROR_STORED | SenseError.StatusKey) to the client.

If the Open is found and the FILE_NO_INTERMEDIATE_BUFFERING bit is not set in Open.CreateOptions, the server MUST fail the request with the STATUS_NOT_SUPPORTED code.

If the Open is found and Open.IsVirtualSCSIDisk is FALSE, the server MUST issue a write to the underlying object store; otherwise the server MUST pass the request to the virtual SCSI disk in an implementation-specific manner.

If the underlying object store or virtual SCSI disk indicates that the write was successful, the server MUST return success to the client.

If the underlying object store or virtual SCSI disk indicates the write was denied due to a persistent reservation conflict, as described in [SPC-3] section 5.6, the server MUST fail the request with error STATUS_SVHDX_RESERVATION_CONFLICT.

Otherwise, if the received error code is specified in the section 2.2.3, the server MUST return the error code.

If the underlying object store is the virtual SCSI disk and the error code is not specified in section 2.2.3, the server MUST store the received sense data and return an error as follows:

  • If Open.SenseErrorSequence is 0xFF, the server MUST reset Open.SenseErrorSequence to 0x00. Otherwise, the server MUST increment the Open.SenseErrorSequence by 0x01.

  • The server MUST update SenseError in Open.SenseErrorDataList at index Open.SenseErrorSequence as follows:

    • SenseError.StatusKey MUST be set to Open.SenseErrorSequence.

    • SenseError.SrbStatus MUST be set to one of the values provided by the virtual SCSI disk, as specified in section 2.2.5.

    • SenseError.ScsiStatus MUST be set to the value provided by the virtual SCSI disk.

    • SenseError.SenseData MUST be set to the data provided by the virtual SCSI disk.<15>

  • The server MUST return the error (STATUS_SVHDX_ERROR_STORED | SenseError.StatusKey) to the client.