Skip to content

Commit 402c43e

Browse files
sjp38jgross1
authored andcommitted
xen-blkfront: Apply 'feature_persistent' parameter when connect
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 aac8a70 ("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 74a8524 ("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: 74a8524 ("xen-blkfront: add a parameter for disabling of persistent grants") Cc: <stable@vger.kernel.org> # 5.10.x Signed-off-by: SeongJae Park <sj@kernel.org> Reviewed-by: Maximilian Heyne <mheyne@amazon.de> Reviewed-by: Juergen Gross <jgross@suse.com> Link: https://lore.kernel.org/r/20220715225108.193398-4-sj@kernel.org Signed-off-by: Juergen Gross <jgross@suse.com>
1 parent e94c610 commit 402c43e

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

Documentation/ABI/testing/sysfs-driver-xen-blkfront

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ KernelVersion: 5.10
1515
Contact: Maximilian Heyne <mheyne@amazon.de>
1616
Description:
1717
Whether to enable the persistent grants feature or not. Note
18-
that this option only takes effect on newly created frontends.
18+
that this option only takes effect on newly connected frontends.
1919
The default is Y (enable).

drivers/block/xen-blkfront.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1988,8 +1988,6 @@ static int blkfront_probe(struct xenbus_device *dev,
19881988
info->vdevice = vdevice;
19891989
info->connected = BLKIF_STATE_DISCONNECTED;
19901990

1991-
info->feature_persistent = feature_persistent;
1992-
19931991
/* Front end dir is a number, which is used as the id. */
19941992
info->handle = simple_strtoul(strrchr(dev->nodename, '/')+1, NULL, 0);
19951993
dev_set_drvdata(&dev->dev, info);
@@ -2283,7 +2281,7 @@ static void blkfront_gather_backend_features(struct blkfront_info *info)
22832281
if (xenbus_read_unsigned(info->xbdev->otherend, "feature-discard", 0))
22842282
blkfront_setup_discard(info);
22852283

2286-
if (info->feature_persistent)
2284+
if (feature_persistent)
22872285
info->feature_persistent =
22882286
!!xenbus_read_unsigned(info->xbdev->otherend,
22892287
"feature-persistent", 0);

0 commit comments

Comments
 (0)