[SCSI] sas: fix removal of devices behind expanders
authorChristoph Hellwig <hch@lst.de>
Wed, 4 Jan 2006 12:45:20 +0000 (13:45 +0100)
committerJames Bottomley <jejb@mulgrave.(none)>
Sat, 14 Jan 2006 16:54:44 +0000 (10:54 -0600)
commitd4054239929479907f20b9d68c905589125ad343
tree09b02453ac3adde7df61ad32f684996f0329874e
parent745caf71d99c5d4ff4c9e4c0f74e64c429fed531
[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: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
drivers/scsi/scsi_transport_sas.c