linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bob Liu <bob.liu@oracle.com>
To: xen-devel@lists.xen.org
Cc: david.vrabel@citrix.com, justing@spectralogic.com,
	konrad.wilk@oracle.com, roger.pau@citrix.com,
	paul.durrant@citrix.com, julien.grall@citrix.com,
	boris.ostrovsky@oracle.com, linux-kernel@vger.kernel.org,
	Bob Liu <bob.liu@oracle.com>
Subject: [PATCH] drivers: xen-blkfront: blkif_recover: recheck feature-persistent
Date: Tue, 26 May 2015 08:11:34 +0800	[thread overview]
Message-ID: <1432599094-22245-1-git-send-email-bob.liu@oracle.com> (raw)

When migrate from !feature-persistent host to feature-persistent host, domU
still think new host/backend don't support persistent.
Dmesg like:
backed has not unmapped grant: 839
backed has not unmapped grant: 773
backed has not unmapped grant: 773
backed has not unmapped grant: 773
backed has not unmapped grant: 839

We should recheck whether the new backend support feature-persistent during
blkif_recover().

Signed-off-by: Bob Liu <bob.liu@oracle.com>
---
 drivers/block/xen-blkfront.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index d3c1a95..cad4d8c 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -1504,7 +1504,7 @@ static int blkif_recover(struct blkfront_info *info)
 	int i;
 	struct request *req, *n;
 	struct blk_shadow *copy;
-	int rc;
+	int rc, persistent;
 	struct bio *bio, *cloned_bio;
 	struct bio_list bio_list, merge_bio;
 	unsigned int segs, offset;
@@ -1525,6 +1525,14 @@ static int blkif_recover(struct blkfront_info *info)
 	info->shadow_free = info->ring.req_prod_pvt;
 	info->shadow[BLK_RING_SIZE(info)-1].req.u.rw.id = 0x0fffffff;
 
+	/* Should check whether the new backend support feature-persistent */
+	rc = xenbus_gather(XBT_NIL, info->xbdev->otherend,
+			    "feature-persistent", "%u", &persistent,
+			    NULL);
+	if (rc)
+		info->feature_persistent = 0;
+	else
+		info->feature_persistent = persistent;
 	rc = blkfront_setup_indirect(info);
 	if (rc) {
 		kfree(copy);
-- 
1.8.3.1


             reply	other threads:[~2015-05-26  0:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-26  0:11 Bob Liu [this message]
2015-06-01  7:50 ` [PATCH] drivers: xen-blkfront: blkif_recover: recheck feature-persistent Roger Pau Monné
2015-06-01  8:30   ` Bob Liu

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=1432599094-22245-1-git-send-email-bob.liu@oracle.com \
    --to=bob.liu@oracle.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=david.vrabel@citrix.com \
    --cc=julien.grall@citrix.com \
    --cc=justing@spectralogic.com \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paul.durrant@citrix.com \
    --cc=roger.pau@citrix.com \
    --cc=xen-devel@lists.xen.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;
as well as URLs for NNTP newsgroup(s).