提交 c666aae6 编写于 作者: D Dan Williams 提交者: James Bottomley

[SCSI] libsas: delete device on sas address changed

If the phy is attached to a new sas address unregister the first address
before processing the new attachment.
Signed-off-by: NDan Williams <dan.j.williams@intel.com>
Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
上级 354cf829
...@@ -2005,6 +2005,15 @@ static int sas_rediscover_dev(struct domain_device *dev, int phy_id, bool last) ...@@ -2005,6 +2005,15 @@ static int sas_rediscover_dev(struct domain_device *dev, int phy_id, bool last)
return res; return res;
} }
/* delete the old link */
if (SAS_ADDR(phy->attached_sas_addr) &&
SAS_ADDR(sas_addr) != SAS_ADDR(phy->attached_sas_addr)) {
SAS_DPRINTK("ex %016llx phy 0x%x replace %016llx\n",
SAS_ADDR(dev->sas_addr), phy_id,
SAS_ADDR(phy->attached_sas_addr));
sas_unregister_devs_sas_addr(dev, phy_id, last);
}
return sas_discover_new(dev, phy_id); return sas_discover_new(dev, phy_id);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册