]>
Commit | Line | Data |
---|---|---|
00e5a55c BS |
1 | From f929f666ebaeb17afcb2d88b46e17092b3299ce6 Mon Sep 17 00:00:00 2001 |
2 | From: Steve Ma <steve.ma@intel.com> | |
3 | Date: Fri, 13 Feb 2009 13:18:16 -0800 | |
4 | Subject: [PATCH] libfc: cancel_delayed_work_sync called improperly | |
5 | References: bnc#477931 | |
6 | ||
7 | The cancel_delayed_work_sync routine call can sleep, therefore | |
8 | it cannot be called in any atomic or critical sections of the code. | |
9 | In the routine fc_fabric_logoff, the call is moved out of the | |
10 | critical section, and placed at the end of the routine. | |
11 | In the routine fc_lport_enter_reset, we may not call | |
12 | cancel_delayed_work_sync, because fc_lport_enter_reset is | |
13 | always called when lport mutex locked. So the cancel_delayed_work_sync | |
14 | is moved to the fc_lport_reset routine, before the lport mutex | |
15 | lock and the fc_lport_enter_reset call. | |
16 | ||
17 | Signed-off-by: Steve Ma <steve.ma@intel.com> | |
18 | Signed-off-by: Hannes Reinecke <hare@suse.de> | |
19 | --- | |
20 | drivers/scsi/libfc/fc_lport.c | 4 ++-- | |
21 | 1 files changed, 2 insertions(+), 2 deletions(-) | |
22 | ||
23 | diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c | |
24 | index 780c571..1559195 100644 | |
25 | --- a/drivers/scsi/libfc/fc_lport.c | |
26 | +++ b/drivers/scsi/libfc/fc_lport.c | |
27 | @@ -617,9 +617,9 @@ int fc_fabric_logoff(struct fc_lport *lport) | |
28 | { | |
29 | lport->tt.disc_stop_final(lport); | |
30 | mutex_lock(&lport->lp_mutex); | |
31 | - cancel_delayed_work_sync(&lport->retry_work); | |
32 | fc_lport_enter_logo(lport); | |
33 | mutex_unlock(&lport->lp_mutex); | |
34 | + cancel_delayed_work_sync(&lport->retry_work); | |
35 | return 0; | |
36 | } | |
37 | EXPORT_SYMBOL(fc_fabric_logoff); | |
38 | @@ -919,6 +919,7 @@ static void fc_lport_recv_req(struct fc_lport *lport, struct fc_seq *sp, | |
39 | */ | |
40 | int fc_lport_reset(struct fc_lport *lport) | |
41 | { | |
42 | + cancel_delayed_work_sync(&lport->retry_work); | |
43 | mutex_lock(&lport->lp_mutex); | |
44 | fc_lport_enter_reset(lport); | |
45 | mutex_unlock(&lport->lp_mutex); | |
46 | @@ -939,7 +940,6 @@ static void fc_lport_enter_reset(struct fc_lport *lport) | |
47 | fc_host_port_id(lport->host), fc_lport_state(lport)); | |
48 | ||
49 | fc_lport_state_enter(lport, LPORT_ST_RESET); | |
50 | - cancel_delayed_work_sync(&lport->retry_work); | |
51 | ||
52 | if (lport->dns_rp) | |
53 | lport->tt.rport_logoff(lport->dns_rp); | |
54 | -- | |
55 | 1.5.4.5 | |
56 |