Skip to content

Commit

Permalink
scsi: smartpqi: raid bypass lba calculation fix
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Kevin Barnett <[email protected]>
Signed-off-by: Don Brace <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
  • Loading branch information
kevin Barnett authored and martinkpetersen committed Sep 19, 2016
1 parent abbada7 commit e018ef5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/scsi/smartpqi/smartpqi_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e018ef5

Please sign in to comment.