summaryrefslogtreecommitdiff
path: root/lib/format_pool
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2013-04-21 21:36:08 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2013-04-21 23:13:57 +0200
commit1951798d7225dce35baa7689a308998f27379b6f (patch)
tree88b940bd3ac2d1fbe97b495e24c887907b94cae7 /lib/format_pool
parent5e7eae59da2ce859e99c62b578f9164b87a1f944 (diff)
downloadlvm2-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.c4
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: