diff options
author | Justin Tee <justin.tee@broadcom.com> | 2023-04-17 22:15:52 +0300 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2023-05-08 14:16:04 +0300 |
commit | 84c868a702f520a75af8a6f0bf8084135e09c510 (patch) | |
tree | 9c7bab0494661cd12c5affb77f69817ca8a6ca94 /drivers/scsi/lpfc/lpfc_scsi.c | |
parent | ac9a78681b921877518763ba0e89202254349d1b (diff) | |
download | linux-84c868a702f520a75af8a6f0bf8084135e09c510.tar.xz |
scsi: lpfc: Fix verbose logging for SCSI commands issued to SES devices
For SES LUNs with scsi_device sector_size member set to zero, there is no
point to log an LBA. When verbose FCP driver logging is enabled, sanity
check sector_size before calling scsi_get_lba() on a scsi_cmnd.
Signed-off-by: Justin Tee <justin.tee@broadcom.com>
Link: https://lore.kernel.org/r/20230417191558.83100-2-justintee8345@gmail.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_scsi.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_scsi.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c index e989f130434e..49aa86c477c6 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.c +++ b/drivers/scsi/lpfc/lpfc_scsi.c @@ -4273,7 +4273,8 @@ lpfc_fcp_io_cmd_wqe_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pwqeIn, "x%x SNS x%x x%x LBA x%llx Data: x%x x%x\n", cmd->device->id, cmd->device->lun, cmd, cmd->result, *lp, *(lp + 3), - (u64)scsi_get_lba(cmd), + (cmd->device->sector_size) ? + (u64)scsi_get_lba(cmd) : 0, cmd->retries, scsi_get_resid(cmd)); } |