]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/patches/suse-2.6.27.25/patches.drivers/fcoe-exch-mgr-is-freed-while-lport-still-retrying-s.patch
Revert "Move xen patchset to new version's subdir."
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.25 / patches.drivers / fcoe-exch-mgr-is-freed-while-lport-still-retrying-s.patch
CommitLineData
00e5a55c
BS
1From 32ffe13b1e76244d93fd28087875d5b182472105 Mon Sep 17 00:00:00 2001
2From: Steve Ma <steve.ma@intel.com>
3Date: Wed, 4 Feb 2009 17:29:20 -0800
4Subject: [PATCH] fcoe: exch mgr is freed while lport still retrying sequences
5References: bnc#473603
6
7When a sequence cannot be delivered to the target, the local
8port will schedule retries, While this process is in progress,
9if we destroy the FCoE interface, the fcoe_sw_destroy routine is
10entered, and the fc_exch_mgr_free(lp->emp) is called. Thus
11if fc_exch_alloc() is called when retrying the sequence,
12the mempool_alloc() will fail to allocate the exchange because
13the mempool of the exchange manager has already been released.
14This patch is to cancel any pending retry work of the local
15port before we start to destroy the interface.
16
17Also, when resetting the local port, we should also stop the
18scheduled pending retries.
19
20Signed-off-by: Steve Ma <steve.ma@intel.com>
21Acked-by: John Jolly <jjolly@suse.de>
22---
23 drivers/scsi/libfc/fc_lport.c | 2 ++
24 1 files changed, 2 insertions(+), 0 deletions(-)
25
26diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c
27index 74f4a0f..780c571 100644
28--- a/drivers/scsi/libfc/fc_lport.c
29+++ b/drivers/scsi/libfc/fc_lport.c
30@@ -617,6 +617,7 @@ int fc_fabric_logoff(struct fc_lport *lport)
31 {
32 lport->tt.disc_stop_final(lport);
33 mutex_lock(&lport->lp_mutex);
34+ cancel_delayed_work_sync(&lport->retry_work);
35 fc_lport_enter_logo(lport);
36 mutex_unlock(&lport->lp_mutex);
37 return 0;
38@@ -938,6 +939,7 @@ static void fc_lport_enter_reset(struct fc_lport *lport)
39 fc_host_port_id(lport->host), fc_lport_state(lport));
40
41 fc_lport_state_enter(lport, LPORT_ST_RESET);
42+ cancel_delayed_work_sync(&lport->retry_work);
43
44 if (lport->dns_rp)
45 lport->tt.rport_logoff(lport->dns_rp);
46--
471.5.4.5
48