1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

vgremove: remove internal lvmlock LV

If a VG is forcibly changed from lock_type sanlock to
lock_type none, the internal lvmlock LV is left behind.
If that LV is not removed before vgremove is run on the
VG, then an internal check will be triggered by the
hidden lvmlock LV.  So, check for and remove a left over
lvmlock LV during vgremove.
This commit is contained in:
David Teigland 2019-10-04 12:01:30 -05:00
parent a22729a557
commit b6240c9188

View File

@ -374,6 +374,7 @@ static int _remove_sanlock_lv(struct cmd_context *cmd, struct volume_group *vg)
return 0;
}
log_debug("sanlock lvmlock LV removed");
return 1;
}
@ -1028,6 +1029,13 @@ int lockd_free_vg_before(struct cmd_context *cmd, struct volume_group *vg,
switch (lock_type_num) {
case LOCK_TYPE_NONE:
/*
* If a sanlock VG was forcibly changed to none,
* the sanlock_lv may have been left behind.
*/
if (vg->sanlock_lv)
_remove_sanlock_lv(cmd, vg);
return 1;
case LOCK_TYPE_CLVM:
return 1;
case LOCK_TYPE_DLM: