From: Christof Schmitt Date: Mon, 5 Nov 2007 11:37:46 +0000 (+0100) Subject: [SCSI] zfcp: Remove SCSI devices when removing complete adapter X-Git-Tag: v2.6.25-rc1~1230^2~159 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=e39c8877a41e8f70225baeeb74fade8fe3a80d8b;p=linux-2.6-omap-h63xx.git [SCSI] zfcp: Remove SCSI devices when removing complete adapter The common I/O layer can call remove a handler to inform zfcp that a device disappeared. The handler zfcp_ccw_remove then removes all unit, port and the adapter data structures. Removing the units requires that the SCSI devices are removed first. Signed-off-by: Christof Schmitt Signed-off-by: Swen Schillig Signed-off-by: James Bottomley --- diff --git a/drivers/s390/scsi/zfcp_ccw.c b/drivers/s390/scsi/zfcp_ccw.c index e01cbf152a8..a6a29a24d28 100644 --- a/drivers/s390/scsi/zfcp_ccw.c +++ b/drivers/s390/scsi/zfcp_ccw.c @@ -120,6 +120,9 @@ zfcp_ccw_remove(struct ccw_device *ccw_device) list_for_each_entry_safe(port, p, &adapter->port_remove_lh, list) { list_for_each_entry_safe(unit, u, &port->unit_remove_lh, list) { + if (atomic_test_mask(ZFCP_STATUS_UNIT_REGISTERED, + &unit->status)) + scsi_remove_device(unit->device); zfcp_unit_dequeue(unit); } zfcp_port_dequeue(port);