Skip to contentSkip to conversation

stable-2.02 - lvconvert: improve support for metadata profiles

PATCH Zdenek Kabelac 1 participant 1 message Feb 24, 2021

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=f3babcb59123e61b0ecead3c8547a4c0ad607276
Commit:        f3babcb59123e61b0ecead3c8547a4c0ad607276
Parent:        e2b693fbe6139b0b991ea84a3011a74586b3b702
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Tue Feb 23 23:22:18 2021 +0100
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Tue Feb 23 23:30:46 2021 +0100

lvconvert: improve support for metadata profiles

lvconvert can use thin-profile just like lvcreate. (Added already upstream as part of VDO support).

---
 lib/metadata/lv_manip.c | 3 +++
 tools/lvmcmdline.c      | 1 +
 2 files changed, 4 insertions(+)
lib/metadata/lv_manip.c +3 -0
index 11fab6d7b..0918780f1 100644
@@ -7019,6 +7019,9 @@ struct logical_volume *insert_layer_for_lv(struct cmd_context *cmd,
 	lv_where->le_count = layer_lv->le_count;
 	lv_where->size = (uint64_t) lv_where->le_count * lv_where->vg->extent_size;
 
+	if (lv_where->vg->fid->fmt->features & FMT_CONFIG_PROFILE)
+		lv_where->profile = lv_where->vg->cmd->profile_params->global_metadata_profile;
+
 	/*
 	 * recuresively rename sub LVs
 	 *   currently supported only for thin data layer
tools/lvmcmdline.c +1 -0
index 890aa0551..e82e4c661 100644
@@ -2573,6 +2573,7 @@ static int _prepare_profiles(struct cmd_context *cmd)
 		 * The --commandprofile is assumed otherwise.
 		 */
 		if (!strcmp(cmd->command->name, "lvcreate") ||
+		    !strcmp(cmd->command->name, "lvconvert") ||
 		    !strcmp(cmd->command->name, "vgcreate") ||
 		    !strcmp(cmd->command->name, "lvchange") ||
 		    !strcmp(cmd->command->name, "vgchange")) {