Skip to content

Commit

Permalink
xen-blkback: replace work_pending with work_busy in purge_persistent_…
Browse files Browse the repository at this point in the history
…gnt()

The BUG_ON() in purge_persistent_gnt() will be triggered when previous purge
work haven't finished.

There is a work_pending() before this BUG_ON, but it doesn't account if the work
is still currently running.

CC: stable@vger.kernel.org
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
Signed-off-by: Bob Liu <bob.liu@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
  • Loading branch information
Bob Liu authored and Konrad Rzeszutek Wilk committed Jul 24, 2015
1 parent 7b07675 commit 53bc7dc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/block/xen-blkback/blkback.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,8 @@ static void purge_persistent_gnt(struct xen_blkif *blkif)
return;
}

if (work_pending(&blkif->persistent_purge_work)) {
pr_alert_ratelimited("Scheduled work from previous purge is still pending, cannot purge list\n");
if (work_busy(&blkif->persistent_purge_work)) {
pr_alert_ratelimited("Scheduled work from previous purge is still busy, cannot purge list\n");
return;
}

Expand Down

0 comments on commit 53bc7dc

Please sign in to comment.