summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libsas
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2012-01-20 03:43:08 +0100
committerJames Bottomley <JBottomley@Parallels.com>2012-02-29 22:33:39 +0100
commitc666aae6919114d6cff789d79f80cfa85f3a7339 (patch)
tree86cff11f3ed7482f6bb1a516f82bac24c7055835 /drivers/scsi/libsas
parent[SCSI] libsas: let libata recover links that fail to transmit initial sig-fis (diff)
downloadlinux-c666aae6919114d6cff789d79f80cfa85f3a7339.tar.xz
linux-c666aae6919114d6cff789d79f80cfa85f3a7339.zip
[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: Dan Williams <dan.j.williams@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/libsas')
-rw-r--r--drivers/scsi/libsas/sas_expander.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c
index 7e2d3c4c6171..d63f0fbcd103 100644
--- a/drivers/scsi/libsas/sas_expander.c
+++ b/drivers/scsi/libsas/sas_expander.c
@@ -2005,6 +2005,15 @@ static int sas_rediscover_dev(struct domain_device *dev, int phy_id, bool last)
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);
}