1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-27 18:55:19 +03:00

Attempt a fix for lvm shell accumulating copies of orphan PVs with each "pvs"

invocation.
This commit is contained in:
Petr Rockai 2012-02-29 00:18:27 +00:00
parent b8dd440097
commit 059e87ce7b

View File

@ -2775,7 +2775,8 @@ static int _vg_read_orphan_pv(struct lvmcache_info *info, void *baton)
return 1;
}
/* Make orphan PVs look like a VG */
/* Make orphan PVs look like a VG. FIXME multiple runs will leak memory
* allocated to PVs into the orphan VG pool which is now global. */
static struct volume_group *_vg_read_orphans(struct cmd_context *cmd,
int warnings,
const char *orphan_vgname)
@ -2795,6 +2796,8 @@ static struct volume_group *_vg_read_orphans(struct cmd_context *cmd,
return_NULL;
vg = fmt->orphan_vg;
dm_list_init(&vg->pvs);
vg->pv_count = 0;
baton.warnings = warnings;
baton.vg = vg;