summaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorkevin Barnett <kevin.barnett@microsemi.com>2016-09-16 15:01:51 -0500
committerMartin K. Petersen <martin.petersen@oracle.com>2016-09-19 11:55:26 -0400
commite018ef572ba4ff17caa9e82d5e1b5cea0d76f903 (patch)
tree2e4d5e32414c967c4e44b5ec851434e8596f2344 /drivers/scsi
parentabbada7175999fbd6500b8144e985b779588962f (diff)
downloadlinux-0-day-e018ef572ba4ff17caa9e82d5e1b5cea0d76f903.tar.gz
linux-0-day-e018ef572ba4ff17caa9e82d5e1b5cea0d76f903.tar.xz
scsi: smartpqi: raid bypass lba calculation fix
In the ioaccel path, the calculation of the starting LBA for READ(6)/WRITE(6) SCSI commands does not take into account the most significant 5 bits of the LBA: it only uses the least significant 16 bits of the starting LBA. Reported-by: Mahesh Rajashekhara <mahesh.rajashekhara@microsemi.com> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/smartpqi/smartpqi_init.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index 52cfa268ca957..a535b2661f383 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -1954,7 +1954,8 @@ static int pqi_raid_bypass_submit_scsi_cmd(struct pqi_ctrl_info *ctrl_info,
is_write = true;
/* fall through */
case READ_6:
- first_block = (u64)get_unaligned_be16(&scmd->cmnd[2]);
+ first_block = (u64)(((scmd->cmnd[1] & 0x1f) << 16) |
+ (scmd->cmnd[2] << 8) | scmd->cmnd[3]);
block_cnt = (u32)scmd->cmnd[4];
if (block_cnt == 0)
block_cnt = 256;