提交 73dde8ff 编写于 作者: J Jason Yan 提交者: Xie XiuQi

scsi: libsas: check the ata device status by ata_dev_enabled()

mainline inclusion
from mainline-4.20-rc1
commit 437207d3697f500f34f126a8ab1c29417ba4a184
category: bugfix
bugzilla: 9986
CVE: NA

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

When ata device IDENTIFY failed, the ata device status is ATA_DEV_UNKNOWN. The
libata reported like:

[113518.620433] ata5.00: qc timeout (cmd 0xec)
[113518.653646] ata5.00: failed to IDENTIFY (I/O error, err_mask=0x4)

But libsas verifies the device status by ata_dev_disabled(), which skipped
ATA_DEV_UNKNOWN. This will make libsas think the ata device probing succeed
the device cannot be actually brought up. And even the new bcast of this
device will be considered as flutter and will not probe this device again.

Change ata_dev_disabled() to !ata_dev_enabled() so that libsas can deal with
this if the ata device probe failed. New bcasts can let us try to probe the
device again and bring it up if it is fine to IDENTIFY.
Tested-by: NZhou Yupeng <zhouyupeng1@huawei.com>
Signed-off-by: NJason Yan <yanaijie@huawei.com>
CC: John Garry <john.garry@huawei.com>
CC: Johannes Thumshirn <jthumshirn@suse.de>
CC: Ewan Milne <emilne@redhat.com>
CC: Christoph Hellwig <hch@lst.de>
CC: Tomas Henzl <thenzl@redhat.com>
CC: Dan Williams <dan.j.williams@intel.com>
CC: Hannes Reinecke <hare@suse.com>
Reviewed-by: NJohn Garry <john.garry@huawei.com>
Reviewed-by: NHannes Reinecke <hare@suse.com>
Reviewed-by: NJohannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Nzhengbin <zhengbin13@huawei.com>
Reviewed-by: NJason Yan <yanaijie@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 3be3aeb9
...@@ -793,7 +793,7 @@ void sas_probe_sata(struct asd_sas_port *port) ...@@ -793,7 +793,7 @@ void sas_probe_sata(struct asd_sas_port *port)
/* if libata could not bring the link up, don't surface /* if libata could not bring the link up, don't surface
* the device * the device
*/ */
if (ata_dev_disabled(sas_to_ata_dev(dev))) if (!ata_dev_enabled(sas_to_ata_dev(dev)))
sas_fail_probe(dev, __func__, -ENODEV); sas_fail_probe(dev, __func__, -ENODEV);
else else
sas_ata_store_id(dev); sas_ata_store_id(dev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册