Skip to contentSkip to conversation

LVM2/lib/metadata metadata.c

PATCH [email protected] 1 participant 1 message Feb 29, 2012

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: mornfall at sourceware.org 2012-02-29 00:18:27

Modified files:
lib/metadata : metadata.c

Log message:
Attempt a fix for lvm shell accumulating copies of orphan PVs with each "pvs" invocation.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.491&r2=1.492

lib/metadata/metadata.c +4 -1
@@ -2775,7 +2775,8 @@
 	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 @@
 		return_NULL;
 
 	vg = fmt->orphan_vg;
+        dm_list_init(&vg->pvs);
+	vg->pv_count = 0;
 
 	baton.warnings = warnings;
 	baton.vg = vg;