1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00

Fix pvchange -M1 -u to preserve existing extent locations when there's a VG.

This commit is contained in:
Alasdair Kergon 2008-07-16 10:46:12 +00:00
parent 69e4400774
commit 707c898f66
2 changed files with 14 additions and 0 deletions

View File

@ -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)

View File

@ -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;
}
}