Compartir a través de


3.3.5.8 Receiving an SMB_COM_FLUSH Request

Upon receipt of an SMB_COM_FLUSH Request (section 2.2.4.6.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<252> 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 3.3.4.1.