Commit 5600b0cf authored by Bob Liu's avatar Bob Liu Committed by Luis Henriques

xen-blkback: replace work_pending with work_busy in purge_persistent_gnt()

commit 53bc7dc0 upstream.

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.
Acked-by: default avatarRoger Pau Monné <roger.pau@citrix.com>
Signed-off-by: default avatarBob Liu <bob.liu@oracle.com>
Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent af420956
...@@ -350,8 +350,8 @@ static void purge_persistent_gnt(struct xen_blkif *blkif) ...@@ -350,8 +350,8 @@ static void purge_persistent_gnt(struct xen_blkif *blkif)
return; return;
} }
if (work_pending(&blkif->persistent_purge_work)) { if (work_busy(&blkif->persistent_purge_work)) {
pr_alert_ratelimited(DRV_PFX "Scheduled work from previous purge is still pending, cannot purge list\n"); pr_alert_ratelimited(DRV_PFX "Scheduled work from previous purge is still busy, cannot purge list\n");
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment