[PATCH 3/7] 3w-9xxx: fix transfer length 0 for 6-byte r/w commands

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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-9xxx.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c
index add419d..71ddb7f 100644
--- a/drivers/scsi/3w-9xxx.c
+++ b/drivers/scsi/3w-9xxx.c
@@ -1870,8 +1870,11 @@ static int twa_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id,
 	}
 
 	if (srb) {
-		if (srb->cmnd[0] == READ_6 || srb->cmnd[0] == WRITE_6)
+		if (srb->cmnd[0] == READ_6 || srb->cmnd[0] == WRITE_6) {
 			num_sectors = (u32)srb->cmnd[4];
+			if (num_sectors == 0)
+				num_sectors = 256;
+		}
 
 		if (srb->cmnd[0] == READ_10 || srb->cmnd[0] == WRITE_10)
 			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




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux