Skip to content

Commit

Permalink
[SCSI] libfc: fix: cancel rport retry timer
Browse files Browse the repository at this point in the history
The timer for rport retries wasn't getting canceled, and
would occasionally go off after the module was unloaded.

Add logic to cancel the timer in fc_rport_work().

Since we cancel the timer before deleting the rdata,
it is no longer necessary to do a get_device() for the pending timer.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
  • Loading branch information
Joe Eykholt authored and James Bottomley committed Aug 22, 2009
1 parent 5f7ea3b commit 201e579
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/scsi/libfc/fc_rport.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ static void fc_rport_work(struct work_struct *work)
mutex_unlock(&rdata->rp_mutex);
if (rport_ops->event_callback)
rport_ops->event_callback(lport, rport, event);
cancel_delayed_work_sync(&rdata->retry_work);
if (trans_state == FC_PORTSTATE_ROGUE)
put_device(&rport->dev);
else {
Expand Down Expand Up @@ -433,7 +434,6 @@ static void fc_rport_timeout(struct work_struct *work)
}

mutex_unlock(&rdata->rp_mutex);
put_device(&rport->dev);
}

/**
Expand Down Expand Up @@ -494,7 +494,6 @@ static void fc_rport_error_retry(struct fc_rport *rport, struct fc_frame *fp)
/* no additional delay on exchange timeouts */
if (PTR_ERR(fp) == -FC_EX_TIMEOUT)
delay = 0;
get_device(&rport->dev);
schedule_delayed_work(&rdata->retry_work, delay);
return;
}
Expand Down

0 comments on commit 201e579

Please sign in to comment.