[SCSI] zfcp: Implicitly close all wka ports
authorChristof Schmitt <christof.schmitt@de.ibm.com>
Tue, 18 Aug 2009 13:43:12 +0000 (15:43 +0200)
committerJames Bottomley <James.Bottomley@suse.de>
Sat, 5 Sep 2009 13:49:15 +0000 (08:49 -0500)
An adapter shutdown implicitly closes all open ports. Make sure to
mark all WKA ports as offline, not only the directory server. Also
make sure that no pending wka port work is running when the adapter is
being removed.

Reviewed-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/s390/scsi/zfcp_aux.c
drivers/s390/scsi/zfcp_erp.c
drivers/s390/scsi/zfcp_ext.h
drivers/s390/scsi/zfcp_fc.c

index 870fe79bc7ea6ad642fe3a673667a7fd32ecdb0b..7aba6840243f6da6fe07abcf28a9fb438b7e8749 100644 (file)
@@ -555,6 +555,7 @@ void zfcp_adapter_dequeue(struct zfcp_adapter *adapter)
 
        cancel_work_sync(&adapter->scan_work);
        cancel_work_sync(&adapter->stat_work);
+       zfcp_fc_wka_ports_force_offline(adapter->gs);
        zfcp_adapter_scsi_unregister(adapter);
        sysfs_remove_group(&adapter->ccw_device->dev.kobj,
                           &zfcp_sysfs_adapter_attrs);
index c75d6f35cb5f64d05e88ac8b423d7cb03e2977e6..39e4dd15453fcde90368e99bc4bd7e92d01ba876 100644 (file)
@@ -714,7 +714,7 @@ static void zfcp_erp_adapter_strategy_close(struct zfcp_erp_action *act)
        zfcp_qdio_close(adapter);
        zfcp_fsf_req_dismiss_all(adapter);
        adapter->fsf_req_seq_no = 0;
-       zfcp_fc_wka_port_force_offline(&adapter->gs->ds);
+       zfcp_fc_wka_ports_force_offline(adapter->gs);
        /* all ports and units are closed */
        zfcp_erp_modify_adapter_status(adapter, "erascl1", NULL,
                                       ZFCP_STATUS_COMMON_OPEN, ZFCP_CLEAR);
index eeed322f32d0b7d13351980298a2a5c0e7704ece..1a66695f11a254f982895ff4dd4cefad77fa3b62 100644 (file)
@@ -104,12 +104,10 @@ extern int zfcp_fc_ns_gid_pn(struct zfcp_erp_action *);
 extern void zfcp_fc_plogi_evaluate(struct zfcp_port *, struct fsf_plogi *);
 extern void zfcp_test_link(struct zfcp_port *);
 extern void zfcp_fc_link_test_work(struct work_struct *);
-extern void zfcp_fc_wka_port_force_offline(struct zfcp_wka_port *);
+extern void zfcp_fc_wka_ports_force_offline(struct zfcp_wka_ports *);
 extern void zfcp_fc_wka_ports_init(struct zfcp_adapter *);
 extern int zfcp_fc_execute_els_fc_job(struct fc_bsg_job *);
 extern int zfcp_fc_execute_ct_fc_job(struct fc_bsg_job *);
-extern void zfcp_fc_wka_port_force_offline(struct zfcp_wka_port *);
-
 
 /* zfcp_fsf.c */
 extern int zfcp_fsf_open_port(struct zfcp_erp_action *);
index 94c13bd32b5fbeb1db3c6bba835cbbfe8a6c5f4b..6d0fef92567b7790607e16f85081290ee8513c2f 100644 (file)
@@ -132,7 +132,7 @@ static void zfcp_fc_wka_port_init(struct zfcp_wka_port *wka_port, u32 d_id,
        INIT_DELAYED_WORK(&wka_port->work, zfcp_wka_port_offline);
 }
 
-void zfcp_fc_wka_port_force_offline(struct zfcp_wka_port *wka)
+static void zfcp_fc_wka_port_force_offline(struct zfcp_wka_port *wka)
 {
        cancel_delayed_work_sync(&wka->work);
        mutex_lock(&wka->mutex);
@@ -140,6 +140,15 @@ void zfcp_fc_wka_port_force_offline(struct zfcp_wka_port *wka)
        mutex_unlock(&wka->mutex);
 }
 
+void zfcp_fc_wka_ports_force_offline(struct zfcp_wka_ports *gs)
+{
+       zfcp_fc_wka_port_force_offline(&gs->ms);
+       zfcp_fc_wka_port_force_offline(&gs->ts);
+       zfcp_fc_wka_port_force_offline(&gs->ds);
+       zfcp_fc_wka_port_force_offline(&gs->as);
+       zfcp_fc_wka_port_force_offline(&gs->ks);
+}
+
 void zfcp_fc_wka_ports_init(struct zfcp_adapter *adapter)
 {
        struct zfcp_wka_ports *gs = adapter->gs;
This page took 0.03099 seconds and 5 git commands to generate.