From b6240c91882a98df9eceab0312eec893b7051765 Mon Sep 17 00:00:00 2001 From: David Teigland Date: Fri, 4 Oct 2019 12:01:30 -0500 Subject: [PATCH] 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. --- lib/locking/lvmlockd.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/locking/lvmlockd.c b/lib/locking/lvmlockd.c index 612de5d22..bdd567d7b 100644 --- a/lib/locking/lvmlockd.c +++ b/lib/locking/lvmlockd.c @@ -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: -- 2.43.5