From 2fc66d2835ac6b83cbf671e9a1d9b43edb0e106d Mon Sep 17 00:00:00 2001 From: David Teigland Date: Wed, 20 Mar 2024 09:13:06 -0500 Subject: [PATCH] lvconvert: fix displayed lv name in convert to snapshot --- tools/lvconvert.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/lvconvert.c b/tools/lvconvert.c index 285849b21..efb779b9c 100644 --- a/tools/lvconvert.c +++ b/tools/lvconvert.c @@ -2046,10 +2046,13 @@ static int _lvconvert_snapshot(struct cmd_context *cmd, const char *origin_name) { struct logical_volume *org; - const char *snap_name = display_lvname(lv); + const char *snap_name; uint32_t chunk_size; int zero; + if (!(snap_name = dm_pool_strdup(lv->vg->vgmem, display_lvname(lv)))) + return_0; + if (strcmp(lv->name, origin_name) == 0) { log_error("Unable to use %s as both snapshot and origin.", snap_name); return 0;