2007-11-05 11:46:55

by Swen Schillig

[permalink] [raw]
Subject: [patch 4/6] zfcp: Remove SCSI devices when removing complete adapter

From: Christof Schmitt <[email protected]>

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 <[email protected]>
Signed-off-by: Swen Schillig <[email protected]>
---

drivers/s390/scsi/zfcp_ccw.c | 3 +++
1 file changed, 3 insertions(+)

diff -urpN linux-2.6/drivers/s390/scsi/zfcp_ccw.c linux-2.6-patched/drivers/s390/scsi/zfcp_ccw.c
--- linux-2.6/drivers/s390/scsi/zfcp_ccw.c 2007-11-02 08:37:56.000000000 +0100
+++ linux-2.6-patched/drivers/s390/scsi/zfcp_ccw.c 2007-11-02 08:38:26.000000000 +0100
@@ -120,6 +120,9 @@ zfcp_ccw_remove(struct ccw_device *ccw_d

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);

--