1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

vgread: fix fid transfer for lvm1 and pool format

Assign fid as the last step before returning VG.
Make the format reader for 'lvm1' and 'pool' equal to 'lvm2' format reader.

It has caused memory corruption to lvmetad as it later calls
destroy_instance() to allocated fid. This patch should fix problems
with crashing test lvmetad-lvm1.sh.
This commit is contained in:
Zdenek Kabelac 2013-04-21 21:36:08 +02:00
parent 5e7eae59da
commit 1951798d72
3 changed files with 5 additions and 4 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.99 -
===================================
Fix assignment order for vg fid for lvm1 and pool format.
Fix memleak in dmeventd thin plugin in device list obtaining err path.
Add explicit message about unsupported pvmove for thin/thinpool volumes.
Fix lvmetad error path in lvmetad_vg_lookup() for null vgname.

View File

@ -200,8 +200,6 @@ static struct volume_group *_format1_vg_read(struct format_instance *fid,
if (dm_list_empty(&pvs))
goto_bad;
vg_set_fid(vg, fid);
if (!_check_vgs(&pvs, vg))
goto_bad;
@ -226,6 +224,8 @@ static struct volume_group *_format1_vg_read(struct format_instance *fid,
if ((vg->status & PARTIAL_VG) && !_fix_partial_vg(vg, &pvs))
goto_bad;
vg_set_fid(vg, fid);
return vg;
bad:

View File

@ -122,8 +122,6 @@ static struct volume_group *_pool_vg_read(struct format_instance *fid,
if (!read_pool_pds(fid->fmt, vg_name, vg->vgmem, &pds))
goto_bad;
vg_set_fid(vg, fid);
/* Setting pool seqno to 1 because the code always did this,
* although we don't think it's needed. */
vg->seqno = 1;
@ -155,6 +153,8 @@ static struct volume_group *_pool_vg_read(struct format_instance *fid,
if (!import_pool_segments(&vg->lvs, vg->vgmem, usp, sp_count))
goto_bad;
vg_set_fid(vg, fid);
return vg;
bad: