Fix vgchange for sparse devices
PATCH 1/1 Fix vgchange for sparse devices
Fix vgchange for sparse devices
If we create a sparse snapshot volume with "lvcreate --virtualsize", the volume is not activated or deactivated with vgchange.
This patch fixes it so that vgchange activates and deactivates such volumes.
Signed-off-by Mikulas Patocka <[email protected]>
--- tools/vgchange.c | 4 ++++ 1 file changed, 4 insertions(+)
tools/vgchange.c +4 -0
@@ -96,6 +96,10 @@ static int _activate_lvs_in_vg(struct cmif (!lv_is_visible (lv))continue ; +/* If LV is sparse, activate origin instead */ +if (lv_is_cow (lv) &&lv_is_virtual_origin (origin_from_cow (lv))) + lv =origin_from_cow (lv); +/* Only request activation of snapshot origin devices */ if ((lv->status &SNAPSHOT ) ||lv_is_cow (lv))continue ;
PATCH 1/1 Fix vgchange for sparse devices
Quoted 4 lines · Mikulas Patocka
Fix vgchange for sparse devices
If we create a sparse snapshot volume with "lvcreate --virtualsize", the volume is not activated or deactivated with vgchange.
this is already in tree btw.
But there are several problems with virtual origins because it was never properly implemented.
https://bugzilla.redhat.com/show_bug.cgi?id=733522
https://bugzilla.redhat.com/show_bug.cgi?id=738435
Milan