Re: [PATCH v4 5/6] scsi: ufs: core: Fix double release in ufshcd_abort()
From: Peter Wang (王信友)
Date: Thu Oct 22 2026 - 05:14:26 EST
On Wed, 2026-10-21 at 08:28 -0500, Stanley Jhu wrote:
> On Wed, 2026-10-21 at 21:12 +0800, Peter Wang wrote:
> > If ufshcd_clear_outstanding_reqs(hba, BIT(tag)) returns 0,
> > should we also set err = SUCCESS? Since the tag is already done
> > — either by the ISR or by ufshcd_abort — shouldn't both cases
> > be treated the same?
>
> A return value of 0 here means the completion path, rather than
> this abort path, has claimed the tag and may still be running
> ufshcd_release_scsi_cmd() after it dropped outstanding_lock.
> SUCCESS tells the SCSI error handler it can retry or finish the
> command right away, so a retry could map the same command again
> while the completion path is still unmapping it.
>
> Returning FAILED here also matches the check at the top of
> ufshcd_abort(), which already returns FAILED when the tag is no
> longer set in hba->outstanding_reqs.
>
> Thanks,
> Stanley
Okay, that is correct. Thanks for the explanation.
Peter