* [PATCH V1] smartpqi: raid bypass lba calculation fix
@ 2016-09-16 20:01 Don Brace
2016-09-19 15:55 ` Martin K. Petersen
0 siblings, 1 reply; 2+ messages in thread
From: Don Brace @ 2016-09-16 20:01 UTC (permalink / raw)
To: jejb, john.hall, Kevin.Barnett, Mahesh.Rajashekhara, hch,
scott.teel, Viswas.G, Justin.Lindley, scott.benesh, elliott
Cc: linux-scsi
From: kevin Barnett <kevin.barnett@microsemi.com>
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>
---
drivers/scsi/smartpqi/smartpqi_init.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index 52cfa26..a535b26 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;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH V1] smartpqi: raid bypass lba calculation fix
2016-09-16 20:01 [PATCH V1] smartpqi: raid bypass lba calculation fix Don Brace
@ 2016-09-19 15:55 ` Martin K. Petersen
0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2016-09-19 15:55 UTC (permalink / raw)
To: Don Brace
Cc: jejb, john.hall, Kevin.Barnett, Mahesh.Rajashekhara, hch,
scott.teel, Viswas.G, Justin.Lindley, scott.benesh, elliott,
linux-scsi
>>>>> "Don" == Don Brace <don.brace@microsemi.com> writes:
Don> From: kevin Barnett <kevin.barnett@microsemi.com> In the ioaccel
Don> path, the calculation of the starting LBA for READ(6)/WRITE(6) SCSI
Don> commands does not take into account the most significant 5 bits of
Don> the LBA: it only uses the least significant 16 bits of the starting
Don> LBA.
Applied to 4.9/scsi-queue.
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-09-19 15:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-16 20:01 [PATCH V1] smartpqi: raid bypass lba calculation fix Don Brace
2016-09-19 15:55 ` Martin K. Petersen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.