]> sourceware.org Git - lvm2.git/commitdiff
Attempt a fix for lvm shell accumulating copies of orphan PVs with each "pvs"
authorPetr Rockai <prockai@redhat.com>
Wed, 29 Feb 2012 00:18:27 +0000 (00:18 +0000)
committerPetr Rockai <prockai@redhat.com>
Wed, 29 Feb 2012 00:18:27 +0000 (00:18 +0000)
invocation.

lib/metadata/metadata.c

index c4a428397f3e01070dac141ba79ba196f0c35bab..2bfbab7b1ad5360697679dc732eb4696f67a4a65 100644 (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;
This page took 0.035037 seconds and 5 git commands to generate.