Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2887448rwb; Mon, 15 Aug 2022 13:20:25 -0700 (PDT) X-Google-Smtp-Source: AA6agR46hwymycv/PW/XdzjiKeHDRXx9s1o3/6yNbAgqsGNDrWKZ+xEu+KNWsHCvqj8omXsLNuUz X-Received: by 2002:a17:906:b2d4:b0:731:4594:8ba1 with SMTP id cf20-20020a170906b2d400b0073145948ba1mr11081339ejb.288.1660594814922; Mon, 15 Aug 2022 13:20:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660594814; cv=none; d=google.com; s=arc-20160816; b=JLsSrK5BRa0CJ/dVzQO0bI0oi9CjaIXIqQvWPQz/QC+cqSywwOZkxJCnYyzXYoW3g3 E0+DsGw/3yrZUa0F2IonucsihPukeIdZHo/n8R+7UB5tZwege4eU8oHyJPJWYCxhSKaB t8+jJd1BTZEigNSPZ4rmn/ykoVHXqVG7Crxdy3kpC+tAoryo99sQUOJXWohW/vLubFx/ C6iq3J1iKgo9UcVonu5iM4Hxa44bFEr8wf5dx4BTwC5n2DWqCHtQY4yWxbztzT3Emn8o etcVLsTrvK/SzUQjnU5HX/7GMnLsZsOx1MrBpb4Jt6SThS1hDGSXI92yVkIEYDGIKKNL spiQ== 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=mpuTvK6ykRH/pfUvCKbfq6ETF/dDZrINjMVUW4aSRY8=; b=ghO3XJ/PSM4Uc3nJ6ZUnRxFAjIYMik5t/MzHnDbEluI5arNgtXBdSWSSHDGWZ8vf7U dp91RT+hbgeAuwuYu4+Q45WiVJsjM+hkRsgKisPp0qLWgwxgPU30Ah5cqUMh/F5POfSN 5apFzACzinmTffg1B9bIQ5qekL9gXZu+Oz2krLFo5WIOl9bXu66KH/xQK9lbLbUOy1rT kfTgXF2DsJDXqhU983V6gvjAZAAHMPhDP3gZcDXFyjXrE4sYAr9od5Flr+85kQynS9PV WWG1aDyjF68zrfiTHU90rr7bYJklaLogelchfZ/fGMVE7U5fTqc/OAXHN6FadUO2kscw 4pjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=G2BlLQH8; 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 sb35-20020a1709076da300b00732f7264d62si7554453ejc.746.2022.08.15.13.19.47; Mon, 15 Aug 2022 13:20:14 -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=G2BlLQH8; 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 S231251AbiHOT7K (ORCPT + 99 others); Mon, 15 Aug 2022 15:59:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346061AbiHOT5D (ORCPT ); Mon, 15 Aug 2022 15:57:03 -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 498DE78229; Mon, 15 Aug 2022 11:52:52 -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 60909B810A1; Mon, 15 Aug 2022 18:52:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C4457C433C1; Mon, 15 Aug 2022 18:52:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660589569; bh=6OwoQ0RGXBhOQVY/1FcNs69u0WinqpaeV3J8bWF2GDc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=G2BlLQH82L1tldILYobwfRPapdZk+0OGFmt45ZUh2W+2n/JbuGhxEe8V25tmAW+h1 Wbinhc05FcJQt2yZV1bUNJFBQH4fR8m4/5hqF5pHydE0cziluWKxzyJycMWjqS24R8 GLNqaWBDmtAXqYysFoW2uQE53usBpJt5Qb61POoc= 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.15 758/779] xen-blkfront: Apply feature_persistent parameter when connect Date: Mon, 15 Aug 2022 20:06:42 +0200 Message-Id: <20220815180409.853377245@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@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 @@ -2014,8 +2014,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); @@ -2309,7 +2307,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);