22.214.171.124 Receiving an SMB_COM_FLUSH Request
Upon receipt of an SMB_COM_FLUSH Request (section 126.96.36.199.1), the server MUST confirm that the supplied FID is either the value 0xFFFF ((USHORT)(-1)) or a valid FID representing a file system object held open by the client. The FID is validated by performing a look-up in the Server.Connection.FileOpenTable to find the corresponding Open. If the FID is 0xFFFF, the Server.Connection.FileOpenTable MUST be scanned for all files that were opened by the PID listed in the request header. The server MUST attempt to flush each Server.Open so listed. If the FID is invalid, the server MUST return STATUS_INVALID_HANDLE (ERRDOS/ERRbadfid) to the client.
If the FID is valid, the server MUST ensure that all written data and additional file allocations are committed to each referenced file by the underlying object store. The server MUST NOT respond to the flush request prior to committing all written data and ensuring that additional file allocations have been committed. At minimum, the server MUST ensure that all other clients or local processes that are reading from the file can read the same information as the process performing the flush operation.
The server MUST then attempt to flush each referenced file by invoking the underlying object store using implementation-dependent<251> functionality. If an error Status is generated by any flush operation, the Status is returned in an error response message, and no further processing occurs (no more files are flushed).
The response MUST be sent to the client as specified in section 188.8.131.52.