diff options
author | David Teigland <teigland@redhat.com> | 2019-10-04 12:01:30 -0500 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2019-10-04 12:01:30 -0500 |
commit | b6240c91882a98df9eceab0312eec893b7051765 (patch) | |
tree | 68fa916fd0937f21b8fbbb3a9ae5189cd0acb13c | |
parent | a22729a5577689d896ea13a82e6af7f7dde30412 (diff) | |
download | lvm2-b6240c91882a98df9eceab0312eec893b7051765.tar.gz |
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.
-rw-r--r-- | lib/locking/lvmlockd.c | 8 |
1 files changed, 8 insertions, 0 deletions
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: |