diff options
author | Dan Williams <dan.j.williams@intel.com> | 2012-01-19 18:43:08 -0800 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-02-29 15:33:39 -0600 |
commit | c666aae6919114d6cff789d79f80cfa85f3a7339 (patch) | |
tree | 86cff11f3ed7482f6bb1a516f82bac24c7055835 | |
parent | 354cf82980e2449e71fdaa3c6f170357ebd65467 (diff) | |
download | op-kernel-dev-c666aae6919114d6cff789d79f80cfa85f3a7339.zip op-kernel-dev-c666aae6919114d6cff789d79f80cfa85f3a7339.tar.gz |
[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>
-rw-r--r-- | drivers/scsi/libsas/sas_expander.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c index 7e2d3c4..d63f0fb 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); } |