Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp936104imw; Fri, 15 Jul 2022 16:13:35 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tG7v7uCqgbUHBo6SCxoBht3eUvDUly69WBUDIH6RqmmKCFcuxEhd5Js3tgBHA1y1MxCOvm X-Received: by 2002:a17:90b:1c0b:b0:1f0:23df:5406 with SMTP id oc11-20020a17090b1c0b00b001f023df5406mr18698900pjb.157.1657926814739; Fri, 15 Jul 2022 16:13:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657926814; cv=none; d=google.com; s=arc-20160816; b=bOp4zfFt5LxTaHSSvt7elHsG/Jb0xBPNw14PQSASpUcEDQXR7+n+hxip33l+OAyG2j 3Dexe9sAgYdTp+iftMzXo8qpniwy2Eroa7rp4q6Y3LReYLWXU16HW7HfJGhfpw5jh42t CQfHPGrhDfglv9Yg5DCjEzKBQthgd1BqlLuCZUbdQWOfNMp4BnWJc2l5y8KBOBkRMwa0 GURVoaPm3yBVel+HcVuYMaNsAjUuXCBNoM0/i1ER3NHwdAcz1V/BFS9gmlVXwxez1hCG pLlewDy/6r/slsy6r13SrCsjBwNsdlzCaZWpXyJsCjljjAOQP7sxxYufvKKe30GfYD7r NwtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=jT7esQq1HeXCMA/rh/JETaSEfYUgN6htK5zR0PXyuyc=; b=cG4cO8yvYk7aKiOUImFo1cxt4lu11DsnkKFdACi2BG/GsZ3siLoh6QqFLSC+ToiC4h xBhVI954BskGK8C8WvOlVI1N4mKgS+rQgxRSozTddyv25dxHPFoZO3GF+ffnj4LqL1vK rvGjJOxfwwOgSh4+W6f0hsu/t5hLnTLDEHUmtZ1CdPGcO7qe1aOivSlna1J7Qz46wHeW iek436uE/CPd0QuGWH7PkMIY9JqQsRpSvRvwbwLoqLFouppb8END1TNrN5pK/IfnmnaR U4YWxgDPEug7ijl0KzjZPFAbWUJznZCWczw283q1XCfo+lbqSbAchWbLip/zZeMMSu+o x/0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZtrJxm7J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q128-20020a632a86000000b004161e739b86si6875096pgq.731.2022.07.15.16.13.19; Fri, 15 Jul 2022 16:13:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZtrJxm7J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231728AbiGOWvg (ORCPT + 99 others); Fri, 15 Jul 2022 18:51:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231236AbiGOWvY (ORCPT ); Fri, 15 Jul 2022 18:51:24 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4CC5A4331E; Fri, 15 Jul 2022 15:51:23 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 0AE3CB82EF4; Fri, 15 Jul 2022 22:51:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E108DC341CD; Fri, 15 Jul 2022 22:51:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657925480; bh=AV0+69P96lBk4BCX+QsSeC3xZH+PgsfB0jKHeIQR8Hw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZtrJxm7JK/F+zYUSYRD53qvkq6ZbXXR238NJUdHAlXahrigxJLDmadWU7VzKU3Cbh 66/l/yAsn9WaxtwwUp1gkXZ+C3vr54YHZ9t7fqthSwAnP3AKWQ2MZfSoKs20PzBL6n X+JhJlLr/PWSFFszpvSaWjUYn4ssPaNz01rxUOA6s7N1iZ761rfNJ94TCss3Wn4B8W IElj94yUPXzzIIbpTiwS+N5B9OZYf5h2yjMlpp32bhhM2Ne22oWRw3wnF6Jz2EpSM5 VF0rxuU5zk6Mj8B+bsINHe+hjkGe4hGFItpaotx60zGrLSg01iL+AhTM3tT5d5phH1 aMVXGwwkO3YOQ== From: SeongJae Park To: roger.pau@citrix.com Cc: axboe@kernel.dk, boris.ostrovsky@oracle.com, jgross@suse.com, olekstysh@gmail.com, andrii.chepurnyi82@gmail.com, mheyne@amazon.de, xen-devel@lists.xenproject.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, SeongJae Park Subject: [PATCH v4 3/3] xen-blkfront: Apply 'feature_persistent' parameter when connect Date: Fri, 15 Jul 2022 22:51:08 +0000 Message-Id: <20220715225108.193398-4-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220715225108.193398-1-sj@kernel.org> References: <20220715225108.193398-1-sj@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In some use cases[1], the backend is created while the frontend doesn't support the persistent grants feature, but later the frontend can be changed to support the feature and reconnect. In the past, 'blkback' enabled the persistent grants feature since it unconditionally checked if frontend supports the persistent grants feature for every connect ('connect_ring()') and decided whether it should use persistent grans or not. However, commit aac8a70db24b ("xen-blkback: add a parameter for disabling of persistent grants") has mistakenly changed the behavior. It made the frontend feature support check to not be repeated once it shown the 'feature_persistent' as 'false', or the frontend doesn't support persistent grants. Similar behavioral change has made on 'blkfront' by commit 74a852479c68 ("xen-blkfront: add a parameter for disabling of persistent grants"). This commit changes the behavior of the parameter to make effect for every connect, so that the previous behavior of 'blkfront' can be restored. [1] https://lore.kernel.org/xen-devel/CAJwUmVB6H3iTs-C+U=v-pwJB7-_ZRHPxHzKRJZ22xEPW7z8a=g@mail.gmail.com/ Fixes: 74a852479c68 ("xen-blkfront: add a parameter for disabling of persistent grants") Cc: # 5.10.x Signed-off-by: SeongJae Park --- Documentation/ABI/testing/sysfs-driver-xen-blkfront | 2 +- drivers/block/xen-blkfront.c | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-driver-xen-blkfront b/Documentation/ABI/testing/sysfs-driver-xen-blkfront index 7f646c58832e..4d36c5a10546 100644 --- a/Documentation/ABI/testing/sysfs-driver-xen-blkfront +++ b/Documentation/ABI/testing/sysfs-driver-xen-blkfront @@ -15,5 +15,5 @@ KernelVersion: 5.10 Contact: Maximilian Heyne Description: Whether to enable the persistent grants feature or not. Note - that this option only takes effect on newly created frontends. + that this option only takes effect on newly connected frontends. The default is Y (enable). diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index 3646c0cae672..4e763701b372 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c @@ -1988,8 +1988,6 @@ static int blkfront_probe(struct xenbus_device *dev, info->vdevice = vdevice; info->connected = BLKIF_STATE_DISCONNECTED; - info->feature_persistent = feature_persistent; - /* Front end dir is a number, which is used as the id. */ info->handle = simple_strtoul(strrchr(dev->nodename, '/')+1, NULL, 0); dev_set_drvdata(&dev->dev, info); @@ -2283,7 +2281,7 @@ static void blkfront_gather_backend_features(struct blkfront_info *info) if (xenbus_read_unsigned(info->xbdev->otherend, "feature-discard", 0)) blkfront_setup_discard(info); - if (info->feature_persistent) + if (feature_persistent) info->feature_persistent = !!xenbus_read_unsigned(info->xbdev->otherend, "feature-persistent", 0); -- 2.25.1