----- Original Message -----
> From: "Johannes Thumshirn" <[email protected]>
> To: "Martin K . Petersen" <[email protected]>, "James Bottomley" 
> <[email protected]>, "James Smart"
> <[email protected]>, "Dick Kennedy" <[email protected]>
> Cc: "Linux SCSI Mailinglist" <[email protected]>, "Johannes 
> Thumshirn" <[email protected]>
> Sent: Monday, July 18, 2016 10:06:03 AM
> Subject: [PATCH 1/2] lpfc: call lpfc_sli_validate_fcp_iocb() with the hbalock 
> held
> 
> Call lpfc_sli_validate_fcp_iocb() with the hbalock held, as the pointer to
> iocbq is not guaranteed to still be valid after looking it up.
> 
> Signed-off-by: Johannes Thumshirn <[email protected]>
> ---
>  drivers/scsi/lpfc/lpfc_sli.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
> index 1a248a2..d58ec4c 100644
> --- a/drivers/scsi/lpfc/lpfc_sli.c
> +++ b/drivers/scsi/lpfc/lpfc_sli.c
> @@ -9978,6 +9978,7 @@ lpfc_sli_sum_iocb(struct lpfc_vport *vport, uint16_t
> tgt_id, uint64_t lun_id,
>       struct lpfc_iocbq *iocbq;
>       int sum, i;
>  
> +     spin_lock_irq(&phba->hbalock);
>       for (i = 1, sum = 0; i <= phba->sli.last_iotag; i++) {
>               iocbq = phba->sli.iocbq_lookup[i];
>  
> @@ -9985,6 +9986,7 @@ lpfc_sli_sum_iocb(struct lpfc_vport *vport, uint16_t
> tgt_id, uint64_t lun_id,
>                                               ctx_cmd) == 0)
>                       sum++;
>       }
> +     spin_unlock_irq(&phba->hbalock);
>  
>       return sum;
>  }
> --
> 1.8.5.6
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to [email protected]
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
Hi Johannes

The code looks correct, but I would get a review from James Smart or Dick 
Kennedy at Emulex (now Broadcom :))
Have you experienced an issue already due to this, can you share the stack 
trace of the issue if you have it.

Reviewed-by Laurence Oberman <[email protected]>
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to