[Open-FCoE] [PATCH] fcoe: exch mgr is freed while lport still retrying sequences

Steve Ma steve.ma at intel.com
Fri Jan 30 17:09:00 UTC 2009

When a sequence cannot be delivered to the target, the local
port will schedule retries, While this process is in progress,
if we issue "fcoeadm -d ethX", the fcoe_sw_destroy routine is
entered, and the fc_exch_mgr_free(lp->emp) is called.  Thus
if fc_exch_alloc() is called when retrying the sequence,
the mempool_alloc() will fail to allocate the exchange because
the mempool of the exchange manager has already been released.
This patch is to cancel any pending retry work of the local
port before we start to destroy the interface.

Signed-off-by: Steve Ma <steve.ma at intel.com>

 drivers/scsi/fcoe/fcoe_sw.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/fcoe/fcoe_sw.c b/drivers/scsi/fcoe/fcoe_sw.c
index cf83675..3b16aad 100644
--- a/drivers/scsi/fcoe/fcoe_sw.c
+++ b/drivers/scsi/fcoe/fcoe_sw.c
@@ -301,6 +301,9 @@ static int fcoe_sw_destroy(struct net_device *netdev)
 	if (!lp)
 		return -ENODEV;
+	/* There might be local port retry in progress */
+	cancel_delayed_work_sync(&lp->retry_work);
 	fc = fcoe_softc(lp);
 	/* Logout of the fabric */

More information about the devel mailing list