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

Robert Love robert.w.love at linux.intel.com
Fri Jan 30 17:25:02 UTC 2009


On Fri, 2009-01-30 at 09:09 -0800, Steve Ma wrote:
> 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

What about if the interface is reset while the timer is pending? Also,
is there a reason we wouldn't cancel the timer in libfc?

> 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 */
> 
> _______________________________________________
> devel mailing list
> devel at open-fcoe.org
> http://www.open-fcoe.org/mailman/listinfo/devel




More information about the devel mailing list