Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e018ef57 authored by kevin Barnett's avatar kevin Barnett Committed by Martin K. Petersen
Browse files

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: default avatarMahesh Rajashekhara <mahesh.rajashekhara@microsemi.com>
Signed-off-by: default avatarKevin Barnett <kevin.barnett@microsemi.com>
Signed-off-by: default avatarDon Brace <don.brace@microsemi.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent abbada71
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;