mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-28 05:12:49 +00:00
xen-blkback: Apply 'feature_persistent' parameter when connect
commite94c6101e1
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, commitaac8a70db2
("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=v-pwJB7-_ZRHPxHzKRJZ22xEPW7z8a=g@mail.gmail.com/ Reported-by: Andrii Chepurnyi <andrii.chepurnyi82@gmail.com> Fixes:aac8a70db2
("xen-blkback: add a parameter for disabling of persistent grants") Cc: <stable@vger.kernel.org> # 5.10.x Signed-off-by: Maximilian Heyne <mheyne@amazon.de> 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-3-sj@kernel.org Signed-off-by: Juergen Gross <jgross@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
59bb16373e
commit
f7a9a465a9
2 changed files with 4 additions and 7 deletions
|
@ -42,5 +42,5 @@ KernelVersion: 5.10
|
||||||
Contact: Maximilian Heyne <mheyne@amazon.de>
|
Contact: Maximilian Heyne <mheyne@amazon.de>
|
||||||
Description:
|
Description:
|
||||||
Whether to enable the persistent grants feature or not. Note
|
Whether to enable the persistent grants feature or not. Note
|
||||||
that this option only takes effect on newly created backends.
|
that this option only takes effect on newly connected backends.
|
||||||
The default is Y (enable).
|
The default is Y (enable).
|
||||||
|
|
|
@ -186,8 +186,6 @@ static struct xen_blkif *xen_blkif_alloc(domid_t domid)
|
||||||
__module_get(THIS_MODULE);
|
__module_get(THIS_MODULE);
|
||||||
INIT_WORK(&blkif->free_work, xen_blkif_deferred_free);
|
INIT_WORK(&blkif->free_work, xen_blkif_deferred_free);
|
||||||
|
|
||||||
blkif->vbd.feature_gnt_persistent = feature_persistent;
|
|
||||||
|
|
||||||
return blkif;
|
return blkif;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1086,10 +1084,9 @@ static int connect_ring(struct backend_info *be)
|
||||||
xenbus_dev_fatal(dev, err, "unknown fe protocol %s", protocol);
|
xenbus_dev_fatal(dev, err, "unknown fe protocol %s", protocol);
|
||||||
return -ENOSYS;
|
return -ENOSYS;
|
||||||
}
|
}
|
||||||
if (blkif->vbd.feature_gnt_persistent)
|
|
||||||
blkif->vbd.feature_gnt_persistent =
|
blkif->vbd.feature_gnt_persistent = feature_persistent &&
|
||||||
xenbus_read_unsigned(dev->otherend,
|
xenbus_read_unsigned(dev->otherend, "feature-persistent", 0);
|
||||||
"feature-persistent", 0);
|
|
||||||
|
|
||||||
blkif->vbd.overflow_max_grants = 0;
|
blkif->vbd.overflow_max_grants = 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue