mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-02 01:18:26 +03:00
Fix pvchange -M1 -u to preserve existing extent locations when there's a VG.
This commit is contained in:
parent
82185ada82
commit
239c4fe6db
@ -1,5 +1,6 @@
|
|||||||
Version 2.02.40 -
|
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.
|
Cease recognising snapshot-in-use percentages returned by early devt kernels.
|
||||||
Add backward-compatible flags field to on-disk format_text metadata.
|
Add backward-compatible flags field to on-disk format_text metadata.
|
||||||
Fix dmeventd monitoring libraries to link against liblvm2cmd again. (2.02.39)
|
Fix dmeventd monitoring libraries to link against liblvm2cmd again. (2.02.39)
|
||||||
|
@ -26,6 +26,9 @@ static int _pvchange_single(struct cmd_context *cmd, struct physical_volume *pv,
|
|||||||
struct list mdas;
|
struct list mdas;
|
||||||
uint64_t sector;
|
uint64_t sector;
|
||||||
uint32_t orig_pe_alloc_count;
|
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 *pv_name = pv_dev_name(pv);
|
||||||
const char *tag = NULL;
|
const char *tag = NULL;
|
||||||
@ -171,6 +174,12 @@ static int _pvchange_single(struct cmd_context *cmd, struct physical_volume *pv,
|
|||||||
if (!is_orphan(pv)) {
|
if (!is_orphan(pv)) {
|
||||||
orig_vg_name = pv_vg_name(pv);
|
orig_vg_name = pv_vg_name(pv);
|
||||||
orig_pe_alloc_count = pv_pe_alloc_count(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->vg_name = pv->fmt->orphan_vg_name;
|
||||||
pv->pe_alloc_count = 0;
|
pv->pe_alloc_count = 0;
|
||||||
if (!(pv_write(cmd, pv, NULL, INT64_C(-1)))) {
|
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->vg_name = orig_vg_name;
|
||||||
pv->pe_alloc_count = orig_pe_alloc_count;
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user