Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751143AbbEZAL6 (ORCPT ); Mon, 25 May 2015 20:11:58 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:38155 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750903AbbEZAL5 (ORCPT ); Mon, 25 May 2015 20:11:57 -0400 From: Bob Liu 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 Subject: [PATCH] drivers: xen-blkfront: blkif_recover: recheck feature-persistent Date: Tue, 26 May 2015 08:11:34 +0800 Message-Id: <1432599094-22245-1-git-send-email-bob.liu@oracle.com> X-Mailer: git-send-email 1.7.10.4 X-Source-IP: userv0021.oracle.com [156.151.31.71] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1793 Lines: 53 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 --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/