linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG] scsi: lpfc: possible ABBA deadlock
@ 2021-07-15 10:37 Jia-Ju Bai
  2021-07-24 20:18 ` James Smart
  0 siblings, 1 reply; 2+ messages in thread
From: Jia-Ju Bai @ 2021-07-15 10:37 UTC (permalink / raw)
  To: james.smart, dick.kennedy, jejb, martin.petersen, linux-scsi,
	linux-kernel

Hello,

I find there is a possible ABBA deadlock in the lpfc driver in Linux 5.10:

In lpfc_nvmet_unsol_fcp_issue_abort():
3502:     spin_lock_irqsave(&ctxp->ctxlock, flags);
3504: spin_lock(&phba->sli4_hba.abts_nvmet_buf_list_lock);

In lpfc_sli4_nvmet_xri_aborted():
1787: spin_lock(&phba->sli4_hba.abts_nvmet_buf_list_lock);
1794:     spin_lock(&ctxp->ctxlock);

When lpfc_nvmet_unsol_fcp_issue_abort() and 
lpfc_sli4_nvmet_xri_aborted() are concurrently executed, the deadlock 
can occur.

I am not quite sure whether this possible deadlock is real and how to 
fix it if it is real.
Any feedback would be appreciated, thanks :)


Best wishes,
Jia-Ju Bai

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [BUG] scsi: lpfc: possible ABBA deadlock
  2021-07-15 10:37 [BUG] scsi: lpfc: possible ABBA deadlock Jia-Ju Bai
@ 2021-07-24 20:18 ` James Smart
  0 siblings, 0 replies; 2+ messages in thread
From: James Smart @ 2021-07-24 20:18 UTC (permalink / raw)
  To: Jia-Ju Bai, james.smart, dick.kennedy, jejb, martin.petersen,
	linux-scsi, linux-kernel

On 7/15/2021 3:37 AM, Jia-Ju Bai wrote:
> Hello,
> 
> I find there is a possible ABBA deadlock in the lpfc driver in Linux 5.10:
> 
> In lpfc_nvmet_unsol_fcp_issue_abort():
> 3502:     spin_lock_irqsave(&ctxp->ctxlock, flags);
> 3504: spin_lock(&phba->sli4_hba.abts_nvmet_buf_list_lock);
> 
> In lpfc_sli4_nvmet_xri_aborted():
> 1787: spin_lock(&phba->sli4_hba.abts_nvmet_buf_list_lock);
> 1794:     spin_lock(&ctxp->ctxlock);
> 
> When lpfc_nvmet_unsol_fcp_issue_abort() and 
> lpfc_sli4_nvmet_xri_aborted() are concurrently executed, the deadlock 
> can occur.
> 
> I am not quite sure whether this possible deadlock is real and how to 
> fix it if it is real.
> Any feedback would be appreciated, thanks :)
> 
> 
> Best wishes,
> Jia-Ju Bai

Jia-Ju,

It's a valid issue, but rather difficult to actually occur. We've put 
together a fix and am testing it. Will post when ready.

-- james


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-07-24 20:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-15 10:37 [BUG] scsi: lpfc: possible ABBA deadlock Jia-Ju Bai
2021-07-24 20:18 ` James Smart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).