diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2021-07-20 22:28:13 +0200 |
---|---|---|
committer | Marian Csontos <mcsontos@redhat.com> | 2021-07-22 13:53:50 +0200 |
commit | bec864948785d145bcd19603cb3781d514eb00e8 (patch) | |
tree | 6261cfa8b5f456d391fb9d60cfa2fbf4080fe1dc | |
parent | f29ce593ec5c19296f50a1dbd1adbced1a1a53a7 (diff) | |
download | lvm2-bec864948785d145bcd19603cb3781d514eb00e8.tar.gz |
vgremove: remove forgotten pmspare
As pmspare is an invisible LV it's not getting automatically removed
since vgremove removes only visible LVs and it depending LVs.
If there was no other thin/cache pool volume, such pmspare stayed
undeleted and caused command failure.
So handle explicitelly such forgotten pmspare and remove it.
(cherry picked from commit 5042463c5083cc71546297344058bd0fa523aa5c)
-rw-r--r-- | tools/vgremove.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/vgremove.c b/tools/vgremove.c index 8f73297dc..b6685ae2a 100644 --- a/tools/vgremove.c +++ b/tools/vgremove.c @@ -65,6 +65,10 @@ static int _vgremove_single(struct cmd_context *cmd, const char *vg_name, } } + if (vg->pool_metadata_spare_lv && + !lvremove_single(cmd, vg->pool_metadata_spare_lv, &void_handle)) + return_ECMD_FAILED; + if (!lockd_free_vg_before(cmd, vg, 0)) return_ECMD_FAILED; |