LVM2/lib/format_text format-text.c
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: prajnoha at sourceware.org 2011-03-02 10:23:29
Modified files:
lib/format_text: format-text.c
Log message:
Use a copy if moving an mda from pv fid to vg fid.
We'll destroy the pv fid (with all mdas in it) after merging all pv mdas to a vg in _text_pv_setup fn, hence we need to use a copy here!
lib/format_text/format-text.c +5 -3
@@ -1647,7 +1647,7 @@const char *pvid = (const char *) (*pv->old_id.uuid ? &pv->old_id : &pv->id);struct lvmcache_info *info;unsigned mda_index; -struct metadata_area *pv_mda; +struct metadata_area *pv_mda, *pv_mda_copy;struct mda_context *pv_mdac;uint64_t pe_count;uint64_t size_reduction =0 ;
@@ -1659,8 +1659,10 @@continue ;/* Be sure it's not already in VG's format instance! */ -if (!fid_get_mda_indexed (vg->fid, pvid,ID_LEN , mda_index)) -fid_add_mda (vg->fid, pv_mda, pvid,ID_LEN , mda_index); +if (!fid_get_mda_indexed (vg->fid, pvid,ID_LEN , mda_index)) { + pv_mda_copy =mda_copy (vg->fid->fmt->cmd->mem, pv_mda); +fid_add_mda (vg->fid, pv_mda_copy, pvid,ID_LEN , mda_index); + } } }/*