diff --git a/WHATS_NEW b/WHATS_NEW index 3bac05317..06cd23178 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.40 - ================================ + Fix pvchange -M1 -u to preserve existing extent locations when there's a VG. Cease recognising snapshot-in-use percentages returned by early devt kernels. Add backward-compatible flags field to on-disk format_text metadata. Fix dmeventd monitoring libraries to link against liblvm2cmd again. (2.02.39) diff --git a/tools/pvchange.c b/tools/pvchange.c index c7a0ee714..aedcfc2f9 100644 --- a/tools/pvchange.c +++ b/tools/pvchange.c @@ -26,6 +26,9 @@ static int _pvchange_single(struct cmd_context *cmd, struct physical_volume *pv, struct list mdas; uint64_t sector; uint32_t orig_pe_alloc_count; + /* FIXME Next three only required for format1. */ + uint32_t orig_pe_count, orig_pe_size; + uint64_t orig_pe_start; const char *pv_name = pv_dev_name(pv); const char *tag = NULL; @@ -171,6 +174,12 @@ static int _pvchange_single(struct cmd_context *cmd, struct physical_volume *pv, if (!is_orphan(pv)) { orig_vg_name = pv_vg_name(pv); orig_pe_alloc_count = pv_pe_alloc_count(pv); + + /* FIXME format1 pv_write doesn't preserve these. */ + orig_pe_size = pv_pe_size(pv); + orig_pe_start = pv_pe_start(pv); + orig_pe_count = pv_pe_count(pv); + pv->vg_name = pv->fmt->orphan_vg_name; pv->pe_alloc_count = 0; if (!(pv_write(cmd, pv, NULL, INT64_C(-1)))) { @@ -181,6 +190,10 @@ static int _pvchange_single(struct cmd_context *cmd, struct physical_volume *pv, } pv->vg_name = orig_vg_name; pv->pe_alloc_count = orig_pe_alloc_count; + + pv->pe_size = orig_pe_size; + pv->pe_start = orig_pe_start; + pv->pe_count = orig_pe_count; } }