Skip to content

Commit

Permalink
[SCSI] libfcoe: fcoe_ctlr_destroy use cancel_work_sync instead of flu…
Browse files Browse the repository at this point in the history
…sh_work

Use cancel_work_sync() in place of flush_work(), so that
fcoe_ctlr_destroy() can be called from a workqueue.

Also, purge the receive queue after the recv_work has been cancled because
if recv_work isn't run it's not guaranteed to be empty now.

Signed-off-by: Chris Leech <christopher.leech@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
  • Loading branch information
Chris Leech authored and James Bottomley committed Sep 10, 2009
1 parent 05cc739 commit a4b7cfa
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/scsi/fcoe/libfcoe.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,17 @@ static void fcoe_ctlr_reset_fcfs(struct fcoe_ctlr *fip)
*/
void fcoe_ctlr_destroy(struct fcoe_ctlr *fip)
{
flush_work(&fip->recv_work);
cancel_work_sync(&fip->recv_work);
spin_lock_bh(&fip->fip_recv_list.lock);
__skb_queue_purge(&fip->fip_recv_list);
spin_unlock_bh(&fip->fip_recv_list.lock);

spin_lock_bh(&fip->lock);
fip->state = FIP_ST_DISABLED;
fcoe_ctlr_reset_fcfs(fip);
spin_unlock_bh(&fip->lock);
del_timer_sync(&fip->timer);
flush_work(&fip->link_work);
cancel_work_sync(&fip->link_work);
}
EXPORT_SYMBOL(fcoe_ctlr_destroy);

Expand Down

0 comments on commit a4b7cfa

Please sign in to comment.