For 6-byte r/w commands, transfer length 0 means 256 blocks of data, not 0 block. Signed-off-by: Akinobu Mita <akinobu.mita@xxxxxxxxx> Cc: Kashyap Desai <kashyap.desai@xxxxxxxxxxxxx> Cc: Sumit Saxena <sumit.saxena@xxxxxxxxxxxxx> Cc: Uday Lingala <uday.lingala@xxxxxxxxxxxxx> Cc: megaraidlinux.pdl@xxxxxxxxxxxxx Cc: linux-scsi@xxxxxxxxxxxxxxx --- drivers/scsi/megaraid.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c index bc7b34c..509aead 100644 --- a/drivers/scsi/megaraid.c +++ b/drivers/scsi/megaraid.c @@ -759,6 +759,8 @@ mega_build_cmd(adapter_t *adapter, Scsi_Cmnd *cmd, int *busy) */ if( cmd->cmd_len == 6 ) { mbox->m_out.numsectors = (u32) cmd->cmnd[4]; + if (mbox->m_out.numsectors == 0) + mbox->m_out.numsectors = 256; mbox->m_out.lba = ((u32)cmd->cmnd[1] << 16) | ((u32)cmd->cmnd[2] << 8) | -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html