From 9d9e43b87fd64ac6098a90090bc4132c2782740b Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Wed, 17 Jan 2024 17:13:26 +0100 Subject: [PATCH] vdo: correct vdo header size Previous patch that introduced support for thinpool with vdo not correctly handled header size - as this part is not fully usable yet. We are going to try to use the 0, but current state of code is not yet compliant to this logic so keep vdo_header_size during conversion and alos correctly pass through virtual_extents to vdo formating. --- lib/metadata/metadata-exported.h | 1 + lib/metadata/vdo_manip.c | 2 +- tools/lvconvert.c | 3 +-- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h index 55eb71cbd..8c7bd4583 100644 --- a/lib/metadata/metadata-exported.h +++ b/lib/metadata/metadata-exported.h @@ -980,6 +980,7 @@ struct vdo_convert_params { struct dm_vdo_target_params vdo_params; /* VDO parameters for vdoformat */ const char *lv_name; uint32_t virtual_extents; + uint64_t header_size; activation_change_t activate; int do_zero; int do_wipe_signatures; /* Used for wiping VDO backend volume */ diff --git a/lib/metadata/vdo_manip.c b/lib/metadata/vdo_manip.c index 32568fae7..c8eebe55a 100644 --- a/lib/metadata/vdo_manip.c +++ b/lib/metadata/vdo_manip.c @@ -521,7 +521,7 @@ struct logical_volume *convert_vdo_lv(struct logical_volume *lv, } } - if (!convert_vdo_pool_lv(lv, &vcp->vdo_params, &lv->le_count, 1, 0)) + if (!convert_vdo_pool_lv(lv, &vcp->vdo_params, &lvc.virtual_extents, vcp->do_zero, vcp->header_size)) return_NULL; /* Create VDO LV with the name, we just release above */ diff --git a/tools/lvconvert.c b/tools/lvconvert.c index e50fa666d..52da38319 100644 --- a/tools/lvconvert.c +++ b/tools/lvconvert.c @@ -5479,7 +5479,6 @@ static int _lvconvert_to_vdopool_single(struct cmd_context *cmd, struct volume_group *vg = lv->vg; struct logical_volume *vdo_lv; const char *vg_name = NULL; - uint64_t vdo_pool_header_size; struct vdo_convert_params vcp = { .activate = CHANGE_AEY, .lv_name = arg_str_value(cmd, name_ARG, NULL), @@ -5498,7 +5497,7 @@ static int _lvconvert_to_vdopool_single(struct cmd_context *cmd, } else vcp.lv_name = "lvol%d"; - if (!fill_vdo_target_params(cmd, &vcp.vdo_params, &vdo_pool_header_size, vg->profile)) + if (!fill_vdo_target_params(cmd, &vcp.vdo_params, &vcp.header_size, vg->profile)) goto_out; if (!get_vdo_settings(cmd, &vcp.vdo_params, NULL))