]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
xen-blkback: replace work_pending with work_busy in purge_persistent_gnt()
authorBob Liu <bob.liu@oracle.com>
Wed, 22 Jul 2015 06:40:10 +0000 (14:40 +0800)
committerLuis Henriques <luis.henriques@canonical.com>
Mon, 31 Aug 2015 13:14:06 +0000 (14:14 +0100)
commit 53bc7dc004fecf39e0ba70f2f8d120a1444315d3 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: 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>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
drivers/block/xen-blkback/blkback.c

index 63fc7f06a0146821296e2d4c625f680d6c9ac008..02004e101678263c7645188126b9198a34f3c04d 100644 (file)
@@ -350,8 +350,8 @@ static void purge_persistent_gnt(struct xen_blkif *blkif)
                return;
        }
 
-       if (work_pending(&blkif->persistent_purge_work)) {
-               pr_alert_ratelimited(DRV_PFX "Scheduled work from previous purge is still pending, cannot purge list\n");
+       if (work_busy(&blkif->persistent_purge_work)) {
+               pr_alert_ratelimited(DRV_PFX "Scheduled work from previous purge is still busy, cannot purge list\n");
                return;
        }