[Open-FCoE] [PATCH 1/5] fcoe: reorder destroy to allow for I/O aborts at unregister

Chris Leech christopher.leech at intel.com
Thu Sep 25 19:07:37 UTC 2008


The instance should be detached from the FC transport and SCSI before the
libfc/fcoe internal data is destroyed.  This allows for the terminate_io
callback to be used at destroy time without running into a panic.

Signed-off-by: Chris Leech <christopher.leech at intel.com>
---

 drivers/scsi/fcoe/fcoe_if.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)


diff --git a/drivers/scsi/fcoe/fcoe_if.c b/drivers/scsi/fcoe/fcoe_if.c
index 477f6b7..d5f1df0 100644
--- a/drivers/scsi/fcoe/fcoe_if.c
+++ b/drivers/scsi/fcoe/fcoe_if.c
@@ -155,18 +155,18 @@ int fcoe_destroy_interface(const char *ifname)
 	list_del(&fc->list);
 	write_unlock_bh(&fci->fcoe_hostlist_lock);
 
-	/* Cleanup the fc_lport */
-	fc_lport_destroy(lp);
-	fc_fcp_destroy(lp);
-	if (lp->emp)
-		fc_exch_mgr_free(lp->emp);
+	/* Don't listen for Ethernet packets anymore */
+	dev_remove_pack(&fc->fcoe_packet_type);
 
 	/* Detach from the scsi-ml */
 	fc_remove_host(lp->host);
 	scsi_remove_host(lp->host);
 
-	/* Don't listen for Ethernet packets anymore */
-	dev_remove_pack(&fc->fcoe_packet_type);
+	/* Cleanup the fc_lport */
+	fc_lport_destroy(lp);
+	fc_fcp_destroy(lp);
+	if (lp->emp)
+		fc_exch_mgr_free(lp->emp);
 
 	/* Delete secondary MAC addresses */
 	rtnl_lock();




More information about the devel mailing list