diff options
author | Alasdair G Kergon <agk@redhat.com> | 2016-04-29 19:49:21 +0100 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2016-04-29 19:49:21 +0100 |
commit | c76df666c903b59f069292c4c1507b1ac37a5590 (patch) | |
tree | f0fb06f7150e0acd8ece3e99c5e7fd7730e059b9 | |
parent | e3efcdc9f5d98807ff9887aa602aff1bdc870cbd (diff) | |
download | lvm2-c76df666c903b59f069292c4c1507b1ac37a5590.tar.gz |
raid: Use inherited tags when wiping rmeta.
If there's an activation volume_filter, it might not be possible
to activate the rmeta LVs to wipe them. At least inherit any
LV tags from the parent LV while attempting this.
-rw-r--r-- | WHATS_NEW | 1 | ||||
-rw-r--r-- | lib/metadata/lv_manip.c | 13 |
2 files changed, 14 insertions, 0 deletions
@@ -1,5 +1,6 @@ Version 2.02.152 - ================================== + Use any inherited tags when wiping metadata sub LVs to ensure activation. Add str_list_wipe. Improve support for interrupting procesing of volumes during lvchange. Use failed command return code when lvchanging read-only volume. diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c index 4bce8085d..cd0a78cdf 100644 --- a/lib/metadata/lv_manip.c +++ b/lib/metadata/lv_manip.c @@ -3834,6 +3834,16 @@ static int _lv_extend_layered_lv(struct alloc_handle *ah, return 0; } lv_set_visible(meta_lv); + + /* + * Copy any tags from the new LV to the metadata LV so + * it can be activated temporarily. + */ + if (!str_list_dup(meta_lv->vg->vgmem, &meta_lv->tags, &lv->tags)) { + log_error("Failed to copy tags onto LV %s to clear metadata.", display_lvname(meta_lv)); + return 0; + } + clear_metadata = 1; } @@ -3882,6 +3892,9 @@ static int _lv_extend_layered_lv(struct alloc_handle *ah, return 0; } lv_set_hidden(meta_lv); + + /* Wipe any temporary tags required for activation. */ + str_list_wipe(&meta_lv->tags); } } |