From nobody Sun May 19 01:26:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1657925510; cv=none; d=zohomail.com; s=zohoarc; b=cvOxER69gPjoNlbauYZPzkQ/vmPV3RnwNx3D3v84BIIAbqSVJvRvx7xdmNT+znpGyTlTN1NeZThHoCxlZbf9j4oNs3Jgp5XI28qaU9Q6iR6zYUATvuJF0lfCX6FVyYdfNuu0HbfN7y2lOpcfsnss/MsWDDVyHBFGpNWl9jlSMLQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1657925510; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=h4MCYvsqnFmMTtsQGU9rhIDUKaHK8py2jjweYjlSYWg=; b=eGnoil9y46u9LeikYqiAUTU7mbXxphs3M9coSCdW0kMevRgdsKZbzDS3qs8W8f6V86goHFYo+GWWMQzAfqDxuUjPlAj9W6c9OtKLzgisrE7TjdyKCQeKlHUnfXqWDLvrn8QrMvbgJ/wQs7XWdIAE6ZduPkmyZHEdVyvwcUS6Jco= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1657925510052763.3478121191798; Fri, 15 Jul 2022 15:51:50 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.368573.599925 (Exim 4.92) (envelope-from ) id 1oCU9c-0005YD-Ha; Fri, 15 Jul 2022 22:51:24 +0000 Received: by outflank-mailman (output) from mailman id 368573.599925; Fri, 15 Jul 2022 22:51:24 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oCU9c-0005Y6-F0; Fri, 15 Jul 2022 22:51:24 +0000 Received: by outflank-mailman (input) for mailman id 368573; Fri, 15 Jul 2022 22:51:23 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oCU9b-0005Xu-5q for xen-devel@lists.xenproject.org; Fri, 15 Jul 2022 22:51:23 +0000 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id a4a123c4-0490-11ed-924f-1f966e50362f; Sat, 16 Jul 2022 00:51:21 +0200 (CEST) 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 B9BCFB82EF2; Fri, 15 Jul 2022 22:51:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7E7B9C341C6; Fri, 15 Jul 2022 22:51:17 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: a4a123c4-0490-11ed-924f-1f966e50362f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657925478; bh=dlKaQtwg6yYz18rR7yrtedCSXkIPHob7qvry1GivQwU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zfee0JPaAo7oMHjphPshW1SCisXCB26lmUDf4+N5Lfa3ZXWP/1h9AYnrlFDyOnNGa 8CZCtlA0YcgiyS66d8rMWfTaDRK7BIaeNQsTXBSIJBWZcdIXsm6wJMbEebhJ0AHuHQ E7ljrx5Vc/3IEsYX/sJTdT+2WNJtr8q4TKoP2iBaDXH8ARh4/17mMXAxgC2RbBf/K2 d5QfzG48sV1dKnSkxRUMsXwBfgW5WnZrxs8QqGVmfjqa477pJcj5R1aKWjoD/dg20e pGpPpMEEltiWk3QRupHXiLvkIvon2u4J27h7ydm+P58QnbX7Wq0/CPCdq771cV88PS wvmYZSwRdGvyQ== 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 1/3] xen-blkback: fix persistent grants negotiation Date: Fri, 15 Jul 2022 22:51:06 +0000 Message-Id: <20220715225108.193398-2-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: quoted-printable X-ZohoMail-DKIM: pass (identity @kernel.org) X-ZM-MESSAGEID: 1657925511634100001 Content-Type: text/plain; charset="utf-8" Persistent grants feature can be used only when both backend and the frontend supports the feature. The feature was always supported by 'blkback', but commit aac8a70db24b ("xen-blkback: add a parameter for disabling of persistent grants") has introduced a parameter for disabling it runtime. To avoid the parameter be updated while being used by 'blkback', the commit caches the parameter into 'vbd->feature_gnt_persistent' in 'xen_vbd_create()', and then check if the guest also supports the feature and finally updates the field in 'connect_ring()'. However, 'connect_ring()' could be called before 'xen_vbd_create()', so later execution of 'xen_vbd_create()' can wrongly overwrite 'true' to 'vbd->feature_gnt_persistent'. As a result, 'blkback' could try to use 'persistent grants' feature even if the guest doesn't support the feature. This commit fixes the issue by moving the parameter value caching to 'xen_blkif_alloc()', which allocates the 'blkif'. Because the struct embeds 'vbd' object, which will be used by 'connect_ring()' later, this should be called before 'connect_ring()' and therefore this should be the right and safe place to do the caching. Fixes: aac8a70db24b ("xen-blkback: add a parameter for disabling of persist= ent grants") Cc: # 5.10.x Signed-off-by: Maximilian Heyne Signed-off-by: SeongJae Park Reviewed-by: Juergen Gross Reviewed-by: Maximilian Heyne --- drivers/block/xen-blkback/xenbus.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback= /xenbus.c index 97de13b14175..16c6785d260c 100644 --- a/drivers/block/xen-blkback/xenbus.c +++ b/drivers/block/xen-blkback/xenbus.c @@ -157,6 +157,11 @@ static int xen_blkif_alloc_rings(struct xen_blkif *blk= if) return 0; } =20 +/* Enable the persistent grants feature. */ +static bool feature_persistent =3D true; +module_param(feature_persistent, bool, 0644); +MODULE_PARM_DESC(feature_persistent, "Enables the persistent grants featur= e"); + static struct xen_blkif *xen_blkif_alloc(domid_t domid) { struct xen_blkif *blkif; @@ -181,6 +186,8 @@ static struct xen_blkif *xen_blkif_alloc(domid_t domid) __module_get(THIS_MODULE); INIT_WORK(&blkif->free_work, xen_blkif_deferred_free); =20 + blkif->vbd.feature_gnt_persistent =3D feature_persistent; + return blkif; } =20 @@ -472,12 +479,6 @@ static void xen_vbd_free(struct xen_vbd *vbd) vbd->bdev =3D NULL; } =20 -/* Enable the persistent grants feature. */ -static bool feature_persistent =3D true; -module_param(feature_persistent, bool, 0644); -MODULE_PARM_DESC(feature_persistent, - "Enables the persistent grants feature"); - static int xen_vbd_create(struct xen_blkif *blkif, blkif_vdev_t handle, unsigned major, unsigned minor, int readonly, int cdrom) @@ -520,8 +521,6 @@ static int xen_vbd_create(struct xen_blkif *blkif, blki= f_vdev_t handle, if (bdev_max_secure_erase_sectors(bdev)) vbd->discard_secure =3D true; =20 - vbd->feature_gnt_persistent =3D feature_persistent; - pr_debug("Successful creation of handle=3D%04x (dom=3D%u)\n", handle, blkif->domid); return 0; --=20 2.25.1 From nobody Sun May 19 01:26:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1657925511; cv=none; d=zohomail.com; s=zohoarc; b=aDDycyTrSKw2Yf3jeyExxPShG50jI/9S47ae5scFPR4l3xCFU/a2Yi5MSmgPvkDHrARo7otwC/MAVNJGHDQ89xb/Mn9SpB7l0u7bPPRgc6ubZwmeC/d2lH2ZoEFX3jqGcy3BVKq3t5ho7X9l1xRpaHxkKqvUXvs1xw4EsQd1kXo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1657925511; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=BIDBs1m5fnKztvjUcyRP9cEC003mrfmTZiySrppAeSM=; b=XsWujKzTUrTA4/b+dL0zWfOMMkNxhAjtE3jn6v++lBRWSHc941ViA6vh8j13PufvgjUBuq1nTb897YO5jS3sBeHnh2CZ/vbY6ikOiVKm9o7QXW6e/KblJuJnGFMWk67fS26qbhn9dhQIShcRX4tNTtusxndLgbog+eAyOhmlfxo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1657925511115556.0227119792695; Fri, 15 Jul 2022 15:51:51 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.368576.599948 (Exim 4.92) (envelope-from ) id 1oCU9e-0005xq-IW; Fri, 15 Jul 2022 22:51:26 +0000 Received: by outflank-mailman (output) from mailman id 368576.599948; Fri, 15 Jul 2022 22:51:26 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oCU9e-0005v5-B1; Fri, 15 Jul 2022 22:51:26 +0000 Received: by outflank-mailman (input) for mailman id 368576; Fri, 15 Jul 2022 22:51:25 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oCU9c-0005Xu-Up for xen-devel@lists.xenproject.org; Fri, 15 Jul 2022 22:51:25 +0000 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id a5004039-0490-11ed-924f-1f966e50362f; Sat, 16 Jul 2022 00:51:21 +0200 (CEST) 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 4435B61DA6; Fri, 15 Jul 2022 22:51:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B07D5C341CA; Fri, 15 Jul 2022 22:51:18 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: a5004039-0490-11ed-924f-1f966e50362f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657925479; bh=mrIb/ElueXH2WPoRY6/+AIbMzXNHxy0Ea9Il6Cse/O8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tZxT+pQbuYr4srnjPLlT74GcfOoy9RBpxXwayjAkFgyh5LrNUY2q22OQHx045z57h JdL3SjIYgm+lnKlOTPxlxhxTXrDItgz5B7Iq0KW9mCCuECOsfsPxQLvCGEY2TAaylX 2k3Ob5C7883feGULACavffuwP/y6NAcpUwh1zqITBCaRejmAzNJdScnUecrJbb03C1 56w9YccBqDpPCC3y+dRiauLqFDY13lTcAFOM9J+bJQugs6+dxc7q/fhpTvxXAmKs6/ UFobBSH5woSg6vsIMZc1Ne6tlWWStPO2MzvrYtDH9IlB94a1Y1CeYMd2QJpBnzdiOD V5dPouOxOxBTA== 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 2/3] xen-blkback: Apply 'feature_persistent' parameter when connect Date: Fri, 15 Jul 2022 22:51:07 +0000 Message-Id: <20220715225108.193398-3-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: quoted-printable X-ZohoMail-DKIM: pass (identity @kernel.org) X-ZM-MESSAGEID: 1657925513192100004 Content-Type: text/plain; charset="utf-8" From: Maximilian Heyne 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. This commit changes the behavior of the parameter to make effect for every connect, so that the previous workflow can work again as expected. [1] https://lore.kernel.org/xen-devel/CAJwUmVB6H3iTs-C+U=3Dv-pwJB7-_ZRHPxHz= KRJZ22xEPW7z8a=3Dg@mail.gmail.com/ Reported-by: Andrii Chepurnyi Fixes: aac8a70db24b ("xen-blkback: add a parameter for disabling of persist= ent grants") Cc: # 5.10.x Signed-off-by: Maximilian Heyne Signed-off-by: SeongJae Park Reviewed-by: Juergen Gross Reviewed-by: Maximilian Heyne --- Documentation/ABI/testing/sysfs-driver-xen-blkback | 2 +- drivers/block/xen-blkback/xenbus.c | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-driver-xen-blkback b/Documenta= tion/ABI/testing/sysfs-driver-xen-blkback index 7faf719af165..fac0f429a869 100644 --- a/Documentation/ABI/testing/sysfs-driver-xen-blkback +++ b/Documentation/ABI/testing/sysfs-driver-xen-blkback @@ -42,5 +42,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 backen= ds. + that this option only takes effect on newly connected back= ends. The default is Y (enable). diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback= /xenbus.c index 16c6785d260c..ee7ad2fb432d 100644 --- a/drivers/block/xen-blkback/xenbus.c +++ b/drivers/block/xen-blkback/xenbus.c @@ -186,8 +186,6 @@ static struct xen_blkif *xen_blkif_alloc(domid_t domid) __module_get(THIS_MODULE); INIT_WORK(&blkif->free_work, xen_blkif_deferred_free); =20 - blkif->vbd.feature_gnt_persistent =3D feature_persistent; - return blkif; } =20 @@ -1086,10 +1084,9 @@ static int connect_ring(struct backend_info *be) xenbus_dev_fatal(dev, err, "unknown fe protocol %s", protocol); return -ENOSYS; } - if (blkif->vbd.feature_gnt_persistent) - blkif->vbd.feature_gnt_persistent =3D - xenbus_read_unsigned(dev->otherend, - "feature-persistent", 0); + + blkif->vbd.feature_gnt_persistent =3D feature_persistent && + xenbus_read_unsigned(dev->otherend, "feature-persistent", 0); =20 blkif->vbd.overflow_max_grants =3D 0; =20 --=20 2.25.1 From nobody Sun May 19 01:26:49 2024 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 C0E18C43334 for ; Fri, 15 Jul 2022 22:51:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231736AbiGOWvh (ORCPT ); Fri, 15 Jul 2022 18:51:37 -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: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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: Juergen Gross Reviewed-by: Maximilian Heyne --- 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/Document= ation/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. 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). 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 =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_features(struct b= lkfront_info *info) 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); --=20 2.25.1