From 857f5d6e65c842f1b3cef5390fac256f5572d7d9 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Wed, 12 Jul 2023 13:52:32 +0200 Subject: [PATCH] lvconvert: correction for thin conversion Updates for 39457234db1d92f89d4234e2f2f5b703206281ae. Off-by-one for option array - need 20 fields. Missed to clear lock_args for cachepool. --- lib/metadata/thin_manip.c | 2 +- tools/lvconvert.c | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/metadata/thin_manip.c b/lib/metadata/thin_manip.c index 7fe19c2ff..a44c7cff2 100644 --- a/lib/metadata/thin_manip.c +++ b/lib/metadata/thin_manip.c @@ -462,7 +462,7 @@ int thin_pool_prepare_metadata(struct logical_volume *metadata_lv, char lv_path[PATH_MAX], md_path[64], buffer[512]; const struct dm_config_node *cn; const struct dm_config_value *cv; - const char *argv[19] = { /* Max supported 15 option args */ + const char *argv[20] = { /* Max supported 15 option args */ find_config_tree_str_allow_empty(cmd, global_thin_restore_executable_CFG, NULL) }; int args = 0; diff --git a/tools/lvconvert.c b/tools/lvconvert.c index 519d2b628..bc1d804a9 100644 --- a/tools/lvconvert.c +++ b/tools/lvconvert.c @@ -3398,13 +3398,11 @@ static int _lvconvert_to_pool(struct cmd_context *cmd, * data and meta LVs (they are unlocked and deleted below.) */ if (vg_is_shared(vg)) { - if (to_cachepool) { - data_lv->lock_args = NULL; - metadata_lv->lock_args = NULL; - } else { - data_lv->lock_args = NULL; - metadata_lv->lock_args = NULL; + pool_lv->lock_args = NULL; + data_lv->lock_args = NULL; + metadata_lv->lock_args = NULL; + if (!to_cachepool) { if (!strcmp(vg->lock_type, "sanlock")) pool_lv->lock_args = "pending"; else if (!strcmp(vg->lock_type, "dlm"))