3.3.5.11.1.3 Receiving an FSCTL_SRV_COPYCHUNK Request

This is a request for a server-side data copy as specified in section 2.2.7.2.1. The server MUST identify the source file based on the copychunk resume key field of the FSCTL_SRV_COPYCHUNK request. This copychunk resume key is a value that was returned by the server from an FSCTL_SRV_REQUEST_RESUME_KEY operation. If the copychunk resume key is not valid or does not represent an open file, then the server MUST fail the operation with STATUS_OBJECT_NAME_NOT_FOUND. If the file represented by the resume key is not opened for read-data access, then the server MUST fail the operation with STATUS_ACCESS_DENIED. Likewise, the target file MUST be specified by the Fid in the SMB_COM_NT_TRANSACTION request. If the target file is not opened for write-data access, then the server MUST fail the operation with STATUS_ACCESS_DENIED and ServerStatistics.sts0_permerrors MUST be increased by 1.

The server MUST validate that the amount of data to be written is within the server's configured bounds. If the server determines that the total chunk count is more than Server.MaxCopyChunks, or the size of any chunk is more than Server.MaxCopyChunkSize, or the total size of all chunks exceeds Server.MaxTotalCopyChunkSize, the server MUST fail the request with STATUS_INVALID_PARAMETER and return a response as specified in section 2.2.7.2.2.

The server MUST iterate through the data ranges specified in the request by reading data from the source offset of the source file and writing it to the target offset of the target file. If the underlying object store returns a failure, then the server MUST stop and set the response parameters, as specified in section 2.2.7.2.2, to indicate how much data was successfully written, and set the Status field of the header with the error code received.

If the processing of FSCTL_SRV_COPYCHUNK operation is completed before Server.CopyChunkTimeOut, the server MUST return the FSCTL_SRV_COPYCHUNK response as specified in section 2.2.7.2.2 with the following values and Status field of the header set to STATUS_SUCCESS:

  • ChunksWritten is set to the number of copychunk operations requested by the client.

  • ChunkBytesWritten is set to zero.

  • TotalBytesWritten is set to the total number of bytes written to the destination file.

If the processing of FSCTL_SRV_COPYCHUNK operation is not completed before Server.CopyChunkTimeOut, the server MUST fail the call with Status field of the header set to STATUS_IO_TIMEOUT and return the FSCTL_SRV_COPYCHUNK response as specified in section 2.2.7.2.2.2 with the following values:

  • ChunksWritten is set to the number of copychunk operations performed by the server within the time specified by Server.CopyChunkTimeOut.

  • ChunkBytesWritten is set to zero.

  • TotalBytesWritten is set to the total number of bytes written to the destination file within the time specified by Server.CopyChunkTimeOut.

If the server does not support this operation, then it MUST fail the request with STATUS_NOT_SUPPORTED.