[SCSI] libfc: exch mgr is freed while lport still retrying sequences
authorSteve Ma <steve.ma@intel.com>
Fri, 27 Feb 2009 18:55:13 +0000 (10:55 -0800)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Fri, 6 Mar 2009 21:40:45 +0000 (15:40 -0600)
commitf7db2c150cf5082cf74555f30a1305938041de80
tree51d92a06ddb32fb0fd7757e67f3e3f8c81b39b0b
parent26d9cab558f901051d0b69b2c445c8588931ce8d
[SCSI] libfc: exch mgr is freed while lport still retrying sequences

When a sequence cannot be delivered to the target, the local
port will schedule retries, While this process is in progress,
if we destroy the FCoE interface, 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.

Also, when resetting the local port, we should also stop the
scheduled pending retries.

Signed-off-by: Steve Ma <steve.ma@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
drivers/scsi/libfc/fc_lport.c