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/format1 | |
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/format1')
-rw-r--r-- | lib/format1/format1.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/format1/format1.c b/lib/format1/format1.c index f47ed9523..286422751 100644 --- a/lib/format1/format1.c +++ b/lib/format1/format1.c @@ -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: |