From 8cbba1d16463955c90a4bd18310765ddb2c55ff8 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Fri, 14 Jul 2023 13:27:29 +0200 Subject: [PATCH] lvmlockd: enable vdo conversion As we turn 'already' active/locked LV into a data LV of vdopool, we just keep active lock for such volume (uuid is preserved). --- tools/lvconvert.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tools/lvconvert.c b/tools/lvconvert.c index 1525bad3d..230ffa936 100644 --- a/tools/lvconvert.c +++ b/tools/lvconvert.c @@ -5499,18 +5499,16 @@ static int _lvconvert_to_vdopool_single(struct cmd_context *cmd, } } - if (vg_is_shared(vg)) { - /* FIXME: need to swap locks betwen LVs? */ - log_error("Unable to convert VDO pool in VG with lock_type %s", vg->lock_type); - goto out; - } - if (!fill_vdo_target_params(cmd, &vdo_params, &vdo_pool_header_size, vg->profile)) goto_out; if (!get_vdo_settings(cmd, &vdo_params, NULL)) goto_out; + /* If LV is inactive here, ensure it's not active elsewhere. */ + if (!lockd_lv(cmd, lv, "ex", 0)) + goto_out; + if (!activate_lv(cmd, lv)) { log_error("Cannot activate %s.", display_lvname(lv)); goto out;