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: Adam Radford <linuxraid@xxxxxxx> Cc: linux-scsi@xxxxxxxxxxxxxxx --- drivers/scsi/3w-xxxx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/scsi/3w-xxxx.c b/drivers/scsi/3w-xxxx.c index 2940bd7..e836aee 100644 --- a/drivers/scsi/3w-xxxx.c +++ b/drivers/scsi/3w-xxxx.c @@ -1727,6 +1727,8 @@ static int tw_scsiop_read_write(TW_Device_Extension *tw_dev, int request_id) if (srb->cmnd[0] == READ_6 || srb->cmnd[0] == WRITE_6) { lba = ((u32)srb->cmnd[1] << 16) | ((u32)srb->cmnd[2] << 8) | (u32)srb->cmnd[3]; num_sectors = (u32)srb->cmnd[4]; + if (num_sectors == 0) + num_sectors = 256; } else { lba = ((u32)srb->cmnd[2] << 24) | ((u32)srb->cmnd[3] << 16) | ((u32)srb->cmnd[4] << 8) | (u32)srb->cmnd[5]; num_sectors = (u32)srb->cmnd[8] | ((u32)srb->cmnd[7] << 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