From: Justin Tee Date: Mon, 17 Apr 2023 19:15:52 +0000 (-0700) Subject: scsi: lpfc: Fix verbose logging for SCSI commands issued to SES devices X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=84c868a702f520a75af8a6f0bf8084135e09c510;p=linux.git 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 Link: https://lore.kernel.org/r/20230417191558.83100-2-justintee8345@gmail.com Signed-off-by: Martin K. Petersen --- diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c index e989f130434e4..49aa86c477c66 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)); }