Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1863254rwb; Fri, 19 Aug 2022 10:38:11 -0700 (PDT) X-Google-Smtp-Source: AA6agR7nbL8z1rmwqpqAOOGozbdWGWGHX/mjRq9SWLMJswgyKZfuybIrpHVXNLUNzKdGwsMse7cm X-Received: by 2002:a05:6a00:188a:b0:536:1401:7f65 with SMTP id x10-20020a056a00188a00b0053614017f65mr3520175pfh.1.1660930691642; Fri, 19 Aug 2022 10:38:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660930691; cv=none; d=google.com; s=arc-20160816; b=LfDV5u4fHDyPtnpEhDndStRhqJRQUZvNtyB9E0QZlclbbnuGtlKDqYmFs3XGjm9vxv YlLVktAuqs9rbLDx1cj5hr1wNlssNF4vq0nZe6cD7ykRooimXChHpBJ2Fv188ME2rgsz twL1r1GyxNOeB9JpQGdIUlXqMwQy3Vg7/CYAz8iPp3KwqpETzxdBvyRvLuFDdptr/lfp vR/mJzh6PcOwDv9ftvZUPVAoGoiTzvebWtrR9zS8cDFqXF6xN3TO/xaQbDB8YS3QDpEI sZO2KOvazhJCOqMb2cB9MVtq+3/iZZz5huXwZNiWYziOypwOBO+5yRPJUwnEzxh/ovYN H3bA== 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=kKP+CbH+atqqgVhY60AN2HqwHokZ6iRby8zh0uKHTlo=; b=0OP24TTDiMB5/Oyq31t2HTIPdBtXrlxWohdq+xOgHgvQQEin9XloCcP7R7ItEiW6b6 ldNh70Ci+hvWG/TG0n+JK2I3SwZJzp7EkyEABoIV/wFW6d/mHViBU2HNovD/iA8Xb/yk quBe8SXSpKwR/DDnAsJfrtkoKTbkmOv9AtgOyaNqom17N4XH+Gvv52WFLsjBxueseyRa j0x5Qd3EWPt/cqJXORqGh+Nl8DDH6rQoyE5HD6rRXRTRU2fyevsP7iANvxtSGKK1c0tU Yala5Hbokjcn/m5y3Tohjl5Qf+uWTm1C5Mh2zCUpX3yjmE189L4VXTjg1YdMVVq9USwq T65A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iKapKcvx; 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 n14-20020a170902d2ce00b00153b2d16667si1058466plc.623.2022.08.19.10.38.00; Fri, 19 Aug 2022 10:38:11 -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=iKapKcvx; 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 S1354314AbiHSQwx (ORCPT + 99 others); Fri, 19 Aug 2022 12:52:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354510AbiHSQvG (ORCPT ); Fri, 19 Aug 2022 12:51:06 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3B2B5FD9; Fri, 19 Aug 2022 09:14:03 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 4B70D612DF; Fri, 19 Aug 2022 16:13:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3CD33C433C1; Fri, 19 Aug 2022 16:13:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660925596; bh=P1EHWGhRML/dseS01WW/IttOgRWIagIJPA8gtilp0tA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iKapKcvxaPBCrY4QNzsYWG1qf/FfUzIdQahmCv1MMMoIIPaDlDfrpIp1USaRsWTxf 8pZOQMZZ4JK8xuR2pHpyTeWqOEkrJuLIfXE4yWOgsRu5Sb/2wR/l8Rn29WS3YQNy9w dmy6XnYDbm/bGrTykFV/X0vD92zVc77KiFKBDOxo= 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.10 512/545] xen-blkfront: Apply feature_persistent parameter when connect Date: Fri, 19 Aug 2022 17:44:42 +0200 Message-Id: <20220819153852.407895378@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220819153829.135562864@linuxfoundation.org> References: <20220819153829.135562864@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: SeongJae Park 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 @@ -2088,8 +2088,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); @@ -2393,7 +2391,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);