]>
Commit | Line | Data |
---|---|---|
2cb7cef9 BS |
1 | From 32ffe13b1e76244d93fd28087875d5b182472105 Mon Sep 17 00:00:00 2001 |
2 | From: Steve Ma <steve.ma@intel.com> | |
3 | Date: Wed, 4 Feb 2009 17:29:20 -0800 | |
4 | Subject: [PATCH] fcoe: exch mgr is freed while lport still retrying sequences | |
5 | References: bnc#473603 | |
6 | ||
7 | When a sequence cannot be delivered to the target, the local | |
8 | port will schedule retries, While this process is in progress, | |
9 | if we destroy the FCoE interface, the fcoe_sw_destroy routine is | |
10 | entered, and the fc_exch_mgr_free(lp->emp) is called. Thus | |
11 | if fc_exch_alloc() is called when retrying the sequence, | |
12 | the mempool_alloc() will fail to allocate the exchange because | |
13 | the mempool of the exchange manager has already been released. | |
14 | This patch is to cancel any pending retry work of the local | |
15 | port before we start to destroy the interface. | |
16 | ||
17 | Also, when resetting the local port, we should also stop the | |
18 | scheduled pending retries. | |
19 | ||
20 | Signed-off-by: Steve Ma <steve.ma@intel.com> | |
21 | Acked-by: John Jolly <jjolly@suse.de> | |
22 | --- | |
23 | drivers/scsi/libfc/fc_lport.c | 2 ++ | |
24 | 1 files changed, 2 insertions(+), 0 deletions(-) | |
25 | ||
26 | diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c | |
27 | index 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 | -- | |
47 | 1.5.4.5 | |
48 |