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)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Fri, 24 Jul 2015 13:09:49 +0000 (09:09 -0400)
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>
drivers/block/xen-blkback/blkback.c

index 9121a2c3e26f266c7277fe4efe18626ff6d08061..73c04040c8c8a6be1eac0a852d6fb100fa0230cd 100644 (file)
@@ -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;
        }