提交 40ef3ae5 编写于 作者: X Xingui Yang 提交者: weixin_43408638

scsi: libsas: Grab the ATA port lock in sas_ata_device_link_abort()

mainline inclusion
from mainline-v6.2-rc4
commit a67aad57
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I6NPLN
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a67aad57d9aee41180aff36e54cb72fe4b8d5a5a

----------------------------------------------------------------------

Grab the ATA port lock in sas_ata_device_link_abort() before calling
ata_link_abort() as outlined in this function's locking requirements.

Fixes: 44112922 ("scsi: libsas: Add sas_ata_device_link_abort()")
Signed-off-by: NXingui Yang <yangxingui@huawei.com>
Reviewed-by: NJohn Garry <john.g.garry@oracle.com>
Reviewed-by: NJason Yan <yanaijie@huawei.com>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Nxiabing <xiabing12@h-partners.com>
上级 64f879be
......@@ -880,7 +880,9 @@ void sas_ata_device_link_abort(struct domain_device *device, bool force_reset)
{
struct ata_port *ap = device->sata_dev.ap;
struct ata_link *link = &ap->link;
unsigned long flags;
spin_lock_irqsave(ap->lock, flags);
device->sata_dev.fis[2] = ATA_ERR | ATA_DRDY; /* tf status */
device->sata_dev.fis[3] = ATA_ABORTED; /* tf error */
......@@ -888,5 +890,6 @@ void sas_ata_device_link_abort(struct domain_device *device, bool force_reset)
if (force_reset)
link->eh_info.action |= ATA_EH_RESET;
ata_link_abort(link);
spin_unlock_irqrestore(ap->lock, flags);
}
EXPORT_SYMBOL_GPL(sas_ata_device_link_abort);
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册