[PATCH 6/7] megaraid_mbox: 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: 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/megaraid_mbox.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c
index f0987f2..bed00d4 100644
--- a/drivers/scsi/megaraid/megaraid_mbox.c
+++ b/drivers/scsi/megaraid/megaraid_mbox.c
@@ -1691,6 +1691,8 @@ megaraid_mbox_build_cmd(adapter_t *adapter, struct scsi_cmnd *scp, int *busy)
 			 */
 			if (scp->cmd_len == 6) {
 				mbox->numsectors = (uint32_t)scp->cmnd[4];
+				if (mbox->numsectors == 0)
+					mbox->numsectors = 256;
 				mbox->lba =
 					((uint32_t)scp->cmnd[1] << 16)	|
 					((uint32_t)scp->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




[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