From nobody Mon Sep 29 21:07:47 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B81C8C25B0D for ; Tue, 16 Aug 2022 04:54:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233648AbiHPEy6 (ORCPT ); Tue, 16 Aug 2022 00:54:58 -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-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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=3Dv-pwJB7-_ZRHPxHz= KRJZ22xEPW7z8a=3Dg@mail.gmail.com/ Fixes: 74a852479c68 ("xen-blkfront: add a parameter for disabling of persis= tent 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. N= ote - that this option only takes effect on newly created fronte= nds. + that this option only takes effect on newly connected fron= tends. 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 =3D vdevice; info->connected =3D BLKIF_STATE_DISCONNECTED; =20 - info->feature_persistent =3D feature_persistent; - /* Front end dir is a number, which is used as the id. */ info->handle =3D 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); =20 - if (info->feature_persistent) + if (feature_persistent) info->feature_persistent =3D !!xenbus_read_unsigned(info->xbdev->otherend, "feature-persistent", 0);