mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-04 16:15:11 +00:00
scsi: libsas: Grab the ATA port lock in sas_ata_device_link_abort()
commita67aad57d9
upstream. 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:4411292267
("scsi: libsas: Add sas_ata_device_link_abort()") Signed-off-by: Xingui Yang <yangxingui@huawei.com> Reviewed-by: John Garry <john.g.garry@oracle.com> Reviewed-by: Jason Yan <yanaijie@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
6dc7e36334
commit
1887a4faff
1 changed files with 3 additions and 0 deletions
|
@ -890,7 +890,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 */
|
||||
|
||||
|
@ -898,6 +900,7 @@ 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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue