Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3257634rwb; Mon, 15 Aug 2022 22:30:36 -0700 (PDT) X-Google-Smtp-Source: AA6agR6P/8ICn9cav+KGIiHMGFNsG+uK2y1FmlKwTOA68jmKz7LqWZ6f9er0q7aJM6r6Te/FvFK9 X-Received: by 2002:a63:90c8:0:b0:41b:bcab:2c93 with SMTP id a191-20020a6390c8000000b0041bbcab2c93mr16594551pge.420.1660627836506; Mon, 15 Aug 2022 22:30:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660627836; cv=none; d=google.com; s=arc-20160816; b=QU0Tdi3ouSKGUnh9nEAIZ/cBf7XXILrfAh6vZKlhYkc5RM31WNDT4Orj04YOf2vI9s iEmznZTpRyQhqZ0Q3hAjHeWyPdZpqdpoWJO3SzyCVrIWMAHLVf52I5JQJV3QvEkys46C BZVNZCXDxLrd4wwyVQdRrf7d+2SY48yih8IbUA+l+zwQPB4kwx2PqM4qoUuwYPDdyzkq NwN0aSB2Kgf695IN3Zo5syEVt6WUPGWT50MXXfdzq6z+Zcgu41zsnzdwubAwHmv1CUEG DDg/0IfSQ3MVteoI48v4Qn5VAOq4vu3vKxO0657j71jHSIzOpmWT/t51zuu3WaQlIJXu Pydg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YRitEpZIK/Zh7L8+xur+i5lRzsXnGruvFBBqfgq8qoY=; b=uiUU+YJJZobd1EeljhnPOfEV+7lQtNzc4A/pxdUVwGaE0f8skb04zJFTJENNdHFgP9 5D2P344p4wkrGSlUG1ijkvgjS9cN8zaNV3EIYcJbi5w1kv2SjwlP2uTsxrJuvJUtBB7d AZMIgAgTMDiaPPG8l4ZlRKLqsuzkqXto3bAQjijihQ8rZnbxmt4LWg60iIvFisw1Tx/L l7ChiQcgmeX7/XcqExAlXVSQvGwdSHPbdZpAZVKtlbpLP/6jTCZijSPzoDaqCHsjZeUX boNBYEBD0hzcNMhLUeFkhrN2UODKJdnYiwAmTEBaXEnxglGM4h3kptxIp9Ujpl8VkrYe YbcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="h+e/yz03"; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 66-20020a630245000000b0041bf0a54ad0si12959744pgc.729.2022.08.15.22.30.24; Mon, 15 Aug 2022 22:30:36 -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=@linuxfoundation.org header.s=korg header.b="h+e/yz03"; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233642AbiHPEy5 (ORCPT + 99 others); Tue, 16 Aug 2022 00:54:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232954AbiHPEw5 (ORCPT ); Tue, 16 Aug 2022 00:52:57 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74922DC5FB; Mon, 15 Aug 2022 13:50:27 -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 07751B811AE; Mon, 15 Aug 2022 20:50:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5E3E5C433D6; Mon, 15 Aug 2022 20:50:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660596609; bh=MsEhOj8Qw2f+7dwtLKYlVGPmwlVQcICvLjrC7CX41Bk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h+e/yz03ViA4rEr5TBgdQ+/pRnt+ghgsPuHyjJeI8P0eYjyh4ZZZ4QU4YjjJSycdR 9Mt164je++yS+QW/BG7Q2PcVBkIVz48mXLGpxoLS4z4UFAvMjHtyl6YwEYMsNQP/0h AGxtCkX/7Re3mO2CaiUhTSHVla+ebyIK7q0uFuxA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, SeongJae Park , Maximilian Heyne , Juergen Gross Subject: [PATCH 5.19 1135/1157] xen-blkfront: Apply feature_persistent parameter when connect Date: Mon, 15 Aug 2022 20:08:11 +0200 Message-Id: <20220815180525.838444350@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 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,T_SCC_BODY_TEXT_LINE 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 From: SeongJae Park commit 402c43ea6b34a1b371ffeed9adf907402569eaf5 upstream. 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 Reviewed-by: Maximilian Heyne Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/20220715225108.193398-4-sj@kernel.org Signed-off-by: Juergen Gross Signed-off-by: Greg Kroah-Hartman --- Documentation/ABI/testing/sysfs-driver-xen-blkfront | 2 +- drivers/block/xen-blkfront.c | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) --- 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). --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c @@ -1988,8 +1988,6 @@ static int blkfront_probe(struct xenbus_ 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_feat 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);