From 91f869e43c8f3161d8bcc54477dfab4024a73a58 Mon Sep 17 00:00:00 2001 From: David Teigland Date: Fri, 2 Oct 2020 09:23:25 -0500 Subject: [PATCH] lvconvert: move log message to fix segfault log message was printing lv name from released vg --- tools/lvconvert.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/lvconvert.c b/tools/lvconvert.c index a4ec48ede..7d5a541d0 100644 --- a/tools/lvconvert.c +++ b/tools/lvconvert.c @@ -5774,14 +5774,15 @@ static int _lvconvert_detach_writecache_when_clean(struct cmd_context *cmd, backup(vg); out_release: + if (ret) + log_print_unless_silent("Logical volume %s write cache has been detached.", display_lvname(lv)); + unlock_and_release_vg(cmd, vg, vg->name); out_lockd: if (!lockd_vg(cmd, id->vg_name, "un", 0, &lockd_state)) stack; - if (ret) - log_print_unless_silent("Logical volume %s write cache has been detached.", display_lvname(lv)); return ret; }