[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1400769607-17278-1-git-send-email-roger.pau@citrix.com>
Date: Thu, 22 May 2014 16:40:07 +0200
From: Roger Pau Monne <roger.pau@...rix.com>
To: <xen-devel@...ts.xenproject.org>, <linux-kernel@...r.kernel.org>
CC: Roger Pau Monne <roger.pau@...rix.com>,
Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
David Vrabel <david.vrabel@...rix.com>
Subject: [PATCH] xen-blkfront: check feature-persitent on resume
We are missing a check to see if the backend supports persistent
grants on resume, meaning we will always run with the value fetched
from the firsts host on which we run on.
Signed-off-by: Roger Pau Monné <roger.pau@...rix.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
Cc: David Vrabel <david.vrabel@...rix.com>
---
drivers/block/xen-blkfront.c | 23 ++++++++++++++++-------
1 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index efe1b47..00ae36b 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -1430,6 +1430,20 @@ static void split_bio_end(struct bio *bio, int error)
bio_put(bio);
}
+static void blkfront_setup_persistent(struct blkfront_info *info)
+{
+ unsigned int persistent;
+ int err;
+
+ err = xenbus_gather(XBT_NIL, info->xbdev->otherend,
+ "feature-persistent", "%u", &persistent,
+ NULL);
+ if (err)
+ info->feature_persistent = 0;
+ else
+ info->feature_persistent = persistent;
+}
+
static int blkif_recover(struct blkfront_info *info)
{
int i;
@@ -1456,6 +1470,7 @@ static int blkif_recover(struct blkfront_info *info)
info->shadow_free = info->ring.req_prod_pvt;
info->shadow[BLK_RING_SIZE-1].req.u.rw.id = 0x0fffffff;
+ blkfront_setup_persistent(info);
rc = blkfront_setup_indirect(info);
if (rc) {
kfree(copy);
@@ -1851,13 +1866,7 @@ static void blkfront_connect(struct blkfront_info *info)
if (!err && discard)
blkfront_setup_discard(info);
- err = xenbus_gather(XBT_NIL, info->xbdev->otherend,
- "feature-persistent", "%u", &persistent,
- NULL);
- if (err)
- info->feature_persistent = 0;
- else
- info->feature_persistent = persistent;
+ blkfront_setup_persistent(info);
err = blkfront_setup_indirect(info);
if (err) {
--
1.7.7.5 (Apple Git-26)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists