Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754018AbbGUJcm (ORCPT ); Tue, 21 Jul 2015 05:32:42 -0400 Received: from smtp02.citrix.com ([66.165.176.63]:57315 "EHLO SMTP02.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753691AbbGUJch (ORCPT ); Tue, 21 Jul 2015 05:32:37 -0400 X-IronPort-AV: E=Sophos;i="5.15,515,1432598400"; d="scan'208";a="285997930" Message-ID: <55AE11B1.4030000@citrix.com> Date: Tue, 21 Jul 2015 11:32:33 +0200 From: =?windows-1252?Q?Roger_Pau_Monn=E9?= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Bob Liu , CC: , , Subject: Re: [PATCH 1/3] xen-blkfront: introduce blkfront_gather_backend_features() References: <1437449441-2964-1-git-send-email-bob.liu@oracle.com> In-Reply-To: <1437449441-2964-1-git-send-email-bob.liu@oracle.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-DLP: MIA1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2256 Lines: 54 El 21/07/15 a les 5.30, Bob Liu ha escrit: > There is a bug when migrate from !feature-persistent host to feature-persistent > host, because 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 > > The fix is to recheck feature-persistent of new backend in blkif_recover(). > See: https://lkml.org/lkml/2015/5/25/469 > > As Roger suggested, we can split the part of blkfront_connect that checks for > optional features, like persistent grants, indirect descriptors and > flush/barrier features to a separate function and call it from both > blkfront_connect and blkif_recover > > Signed-off-by: Bob Liu Thanks for taking care of this. The patch looks fine, just one minor nit. > --- > drivers/block/xen-blkfront.c | 118 +++++++++++++++++++++++------------------- > 1 file changed, 66 insertions(+), 52 deletions(-) > > diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c > index 5b45ee5..e266d17 100644 > --- a/drivers/block/xen-blkfront.c > +++ b/drivers/block/xen-blkfront.c > @@ -181,6 +181,7 @@ static DEFINE_SPINLOCK(minor_lock); > ((_segs + SEGS_PER_INDIRECT_FRAME - 1)/SEGS_PER_INDIRECT_FRAME) > > static int blkfront_setup_indirect(struct blkfront_info *info); > +static void blkfront_gather_backend_features(struct blkfront_info *info); > > static int get_id_from_freelist(struct blkfront_info *info) > { > @@ -1514,6 +1515,7 @@ 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; > > + blkfront_gather_backend_features(info); > rc = blkfront_setup_indirect(info); AFAICT you can put the call to blkfront_setup_indirect inside of blkfront_gather_backend_features, like it's done for blkfront_setup_discard. Roger. -- 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/