提交 d4054239 编写于 作者: C Christoph Hellwig 提交者: James Bottomley

[SCSI] sas: fix removal of devices behind expanders

We need to iterate over all children when removing and expander, else
stale objects will be around after host removal.  This fixes the oops
Eric Moore saw when removing and reloading mptsas.

Also don't try the scsi_remove_target call unless operating on an end
device.  The current unconditional call is harmless but confusing.
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
上级 745caf71
...@@ -687,7 +687,17 @@ sas_rphy_delete(struct sas_rphy *rphy) ...@@ -687,7 +687,17 @@ sas_rphy_delete(struct sas_rphy *rphy)
struct Scsi_Host *shost = dev_to_shost(parent->dev.parent); struct Scsi_Host *shost = dev_to_shost(parent->dev.parent);
struct sas_host_attrs *sas_host = to_sas_host_attrs(shost); struct sas_host_attrs *sas_host = to_sas_host_attrs(shost);
scsi_remove_target(dev); switch (rphy->identify.device_type) {
case SAS_END_DEVICE:
scsi_remove_target(dev);
break;
case SAS_EDGE_EXPANDER_DEVICE:
case SAS_FANOUT_EXPANDER_DEVICE:
device_for_each_child(dev, NULL, do_sas_phy_delete);
break;
default:
break;
}
transport_remove_device(dev); transport_remove_device(dev);
device_del(dev); device_del(dev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册