diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2013-04-21 21:36:08 +0200 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2013-04-21 23:13:57 +0200 |
commit | 1951798d7225dce35baa7689a308998f27379b6f (patch) | |
tree | 88b940bd3ac2d1fbe97b495e24c887907b94cae7 /lib/format_pool | |
parent | 5e7eae59da2ce859e99c62b578f9164b87a1f944 (diff) | |
download | lvm2-1951798d7225dce35baa7689a308998f27379b6f.tar.gz |
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.
Diffstat (limited to 'lib/format_pool')
-rw-r--r-- | lib/format_pool/format_pool.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/format_pool/format_pool.c b/lib/format_pool/format_pool.c index c05196848..0891524e9 100644 --- a/lib/format_pool/format_pool.c +++ b/lib/format_pool/format_pool.c @@ -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: |