diff options
author | Quinn Tran <qutran@marvell.com> | 2023-08-17 12:01:32 +0530 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2023-08-21 17:37:42 -0400 |
commit | ae25f65a351ca9c650887c2b37319fa9a41ec258 (patch) | |
tree | 6ea183ebbc76d88b57d4b11144a9b3a8ff585154 /drivers/scsi/qla2xxx/qla_nx.h | |
parent | efeda3bf912f269bcae16816683f432f58d68075 (diff) | |
download | linux-stable-ae25f65a351ca9c650887c2b37319fa9a41ec258.tar.gz linux-stable-ae25f65a351ca9c650887c2b37319fa9a41ec258.tar.bz2 linux-stable-ae25f65a351ca9c650887c2b37319fa9a41ec258.zip |
scsi: qla2xxx: Allow 32-byte CDBs
System crashes when a 32-byte CDB was sent to a non T10 PI disk:
[ 177.143279] ? qla2xxx_dif_start_scsi_mq+0xcd8/0xce0 [qla2xxx]
[ 177.149165] ? internal_add_timer+0x42/0x70
[ 177.153372] qla2xxx_mqueuecommand+0x207/0x2b0 [qla2xxx]
[ 177.158730] scsi_queue_rq+0x2b7/0xc00
[ 177.162501] blk_mq_dispatch_rq_list+0x3ea/0x7e0
Current code attempted to use CRC IOCB to send the command but failed.
Instead, type 6 IOCB should be used to send the I/O.
Clone existing type 6 IOCB code with addition of MQ support to allow
32-byte CDBs to go through.
Signed-off-by: Quinn Tran <qutran@marvell.com>
Cc: Laurence Oberman <loberman@redhat.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Link: https://lore.kernel.org/r/20230817063132.21900-3-njavali@marvell.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_nx.h')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_nx.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/scsi/qla2xxx/qla_nx.h b/drivers/scsi/qla2xxx/qla_nx.h index 6dc80c8ddf79..5d1bdc15b75c 100644 --- a/drivers/scsi/qla2xxx/qla_nx.h +++ b/drivers/scsi/qla2xxx/qla_nx.h @@ -857,7 +857,9 @@ struct fcp_cmnd { uint8_t task_attribute; uint8_t task_management; uint8_t additional_cdb_len; - uint8_t cdb[260]; /* 256 for CDB len and 4 for FCP_DL */ +#define QLA_CDB_BUF_SIZE 256 +#define QLA_FCP_DL_SIZE 4 + uint8_t cdb[QLA_CDB_BUF_SIZE + QLA_FCP_DL_SIZE]; /* 256 for CDB len and 4 for FCP_DL */ }; struct dsd_dma { |