mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bob Liu <bob.liu@oracle.com>
To: xen-devel@lists.xenproject.org
Cc: david.vrabel@citrix.com, linux-kernel@vger.kernel.org,
	roger.pau@citrix.com, konrad.wilk@oracle.com,
	Bob Liu <bob.liu@oracle.com>
Subject: [PATCH v2] xen-blkback: replace work_pending with work_busy in purge_persistent_gnt()
Date: Wed, 22 Jul 2015 14:40:10 +0800	[thread overview]
Message-ID: <1437547210-32573-3-git-send-email-bob.liu@oracle.com> (raw)
In-Reply-To: <1437547210-32573-1-git-send-email-bob.liu@oracle.com>

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.

Signed-off-by: Bob Liu <bob.liu@oracle.com>
---
Change in v2:
 * Replace with work_busy()
---
 drivers/block/xen-blkback/blkback.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c
index ced9677..954c002 100644
--- a/drivers/block/xen-blkback/blkback.c
+++ b/drivers/block/xen-blkback/blkback.c
@@ -369,8 +369,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;
 	}
 
-- 
1.7.10.4


  parent reply	other threads:[~2015-07-22  6:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-22  6:40 [PATCH v2 1/3] xen-blkfront: introduce blkfront_gather_backend_features() Bob Liu
2015-07-22  6:40 ` [PATCH v2 2/3] xen-blkfront: don't add indirect pages to list when !feature_persistent Bob Liu
2015-07-23  8:59   ` Roger Pau Monné
2015-07-22  6:40 ` Bob Liu [this message]
2015-07-23  9:06   ` [PATCH v2] xen-blkback: replace work_pending with work_busy in purge_persistent_gnt() Roger Pau Monné
2015-07-24 13:10     ` Konrad Rzeszutek Wilk
2015-07-23  9:00 ` [PATCH v2 1/3] xen-blkfront: introduce blkfront_gather_backend_features() Roger Pau Monné

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1437547210-32573-3-git-send-email-bob.liu@oracle.com \
    --to=bob.liu@oracle.com \
    --cc=david.vrabel@citrix.com \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=roger.pau@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®