+++ /dev/null
-From f929f666ebaeb17afcb2d88b46e17092b3299ce6 Mon Sep 17 00:00:00 2001
-From: Steve Ma <steve.ma@intel.com>
-Date: Fri, 13 Feb 2009 13:18:16 -0800
-Subject: [PATCH] libfc: cancel_delayed_work_sync called improperly
-References: bnc#477931
-
-The cancel_delayed_work_sync routine call can sleep, therefore
-it cannot be called in any atomic or critical sections of the code.
-In the routine fc_fabric_logoff, the call is moved out of the
-critical section, and placed at the end of the routine.
-In the routine fc_lport_enter_reset, we may not call
-cancel_delayed_work_sync, because fc_lport_enter_reset is
-always called when lport mutex locked. So the cancel_delayed_work_sync
-is moved to the fc_lport_reset routine, before the lport mutex
-lock and the fc_lport_enter_reset call.
-
-Signed-off-by: Steve Ma <steve.ma@intel.com>
-Signed-off-by: Hannes Reinecke <hare@suse.de>
----
- drivers/scsi/libfc/fc_lport.c | 4 ++--
- 1 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c
-index 780c571..1559195 100644
---- a/drivers/scsi/libfc/fc_lport.c
-+++ b/drivers/scsi/libfc/fc_lport.c
-@@ -617,9 +617,9 @@ int fc_fabric_logoff(struct fc_lport *lport)
- {
- lport->tt.disc_stop_final(lport);
- mutex_lock(&lport->lp_mutex);
-- cancel_delayed_work_sync(&lport->retry_work);
- fc_lport_enter_logo(lport);
- mutex_unlock(&lport->lp_mutex);
-+ cancel_delayed_work_sync(&lport->retry_work);
- return 0;
- }
- EXPORT_SYMBOL(fc_fabric_logoff);
-@@ -919,6 +919,7 @@ static void fc_lport_recv_req(struct fc_lport *lport, struct fc_seq *sp,
- */
- int fc_lport_reset(struct fc_lport *lport)
- {
-+ cancel_delayed_work_sync(&lport->retry_work);
- mutex_lock(&lport->lp_mutex);
- fc_lport_enter_reset(lport);
- mutex_unlock(&lport->lp_mutex);
-@@ -939,7 +940,6 @@ static void fc_lport_enter_reset(struct fc_lport *lport)
- fc_host_port_id(lport->host), fc_lport_state(lport));
-
- fc_lport_state_enter(lport, LPORT_ST_RESET);
-- cancel_delayed_work_sync(&lport->retry_work);
-
- if (lport->dns_rp)
- lport->tt.rport_logoff(lport->dns_rp);
---
-1.5.4.5
-