Skip to contentSkip to conversation

stable-2.02 - lvconvert: can't create cachepool with RAID1 metadata SubLV

PATCH Heinz Mauelshagen 1 participant 1 message Apr 12, 2019

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=699bf8609049058875d84f129d508d4ccbed3900
Commit:        699bf8609049058875d84f129d508d4ccbed3900
Parent:        03d6cfdd99fb1c2fd85721ab6faebbb1b6658873
Author:        Heinz Mauelshagen <[email protected]>
AuthorDate:    Fri Apr 12 21:27:30 2019 +0200
Committer:     Heinz Mauelshagen <[email protected]>
CommitterDate: Fri Apr 12 21:38:04 2019 +0200

lvconvert: can't create cachepool with RAID1 metadata SubLV

Trying to convert an exiting RAID1 LV to cache metadata SubLV fails because of missing exclusive activation during wiping.

Solve by activating the RAID1 metadata SubLV exclusively.

Resolves: rhbz1698866

---
 tools/lvconvert.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
tools/lvconvert.c +2 -2
index 2b3c3ea..bc666c0 100644
@@ -3167,8 +3167,8 @@ static int _lvconvert_to_pool(struct cmd_context *cmd,
 
 		if (zero_metadata) {
 			metadata_lv->status |= LV_ACTIVATION_SKIP;
-			if (!activate_lv(cmd, metadata_lv)) {
-				log_error("Aborting. Failed to activate metadata lv.");
+			if (!activate_lv_excl_local(cmd, metadata_lv)) {
+				log_error("Aborting. Failed to locally activate metadata lv.");
 				goto bad;
 			}
 			metadata_lv->status &= ~LV_ACTIVATION_SKIP;