4.9 Avoiding Buffer Mismatches

The CDM must have a check similar to the pseudo-code below to accommodate applications that allocate oversized buffers when using tape devices running in fixed-block mode.

    If (!Variable_Block_Mode) 
    { 
       if ((unitsize * unitcount) <= CDMMsg->BufferLength) 
          hacb->DataBufferLength = unitsize*unitcount; 
       else 
          hacb->DataBufferLength = CDMMsg->BufferLength; 
    }