Re: [PATCH 1/2] lpfc: call lpfc_sli_validate_fcp_iocb() with the hbalock held

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




----- Original Message -----
> From: "Johannes Thumshirn" <jthumshirn@xxxxxxx>
> To: "Martin K . Petersen" <martin.petersen@xxxxxxxxxx>, "James Bottomley" <jejb@xxxxxxxxxxxxxxxxxx>, "James Smart"
> <james.smart@xxxxxxxxxxxxx>, "Dick Kennedy" <dick.kennedy@xxxxxxxxxxxxx>
> Cc: "Linux SCSI Mailinglist" <linux-scsi@xxxxxxxxxxxxxxx>, "Johannes Thumshirn" <jthumshirn@xxxxxxx>
> 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 <jthumshirn@xxxxxxx>
> ---
>  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 majordomo@xxxxxxxxxxxxxxx
> 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 <loberman@xxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux