[lvm-devel] [PATCH 2/3] Update lvmcache_update_vg to use vgid as well as vgname.

Dave Wysochanski dwysocha at redhat.com
Tue Feb 17 02:55:16 UTC 2009


With duplicate vgnames in a system, vg metadata could get
exported to the wrong lvmcache_vginfo structure.  Use the vg_uuid as
well as the name to lookup the vginfo structure before we store the
metadata.

Signed-off-by: Dave Wysochanski <wysochanski at pobox.com>
Signed-off-by: Dave Wysochanski <dwysocha at redhat.com>
---
 lib/cache/lvmcache.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/cache/lvmcache.c b/lib/cache/lvmcache.c
index d24e9a2..083aab1 100644
--- a/lib/cache/lvmcache.c
+++ b/lib/cache/lvmcache.c
@@ -1068,7 +1068,7 @@ int lvmcache_update_vg(struct volume_group *vg, unsigned precommitted)
 
 	/* store text representation of vg to cache */
 	if (vg->cmd->current_settings.cache_vgmetadata &&
-	    (vginfo = vginfo_from_vgname(vg->name, NULL)))
+	    (vginfo = vginfo_from_vgname(vg->name, (char *)&vg->id)))
 		_store_metadata(vginfo, vg, precommitted);
 
 	return 1;
-- 
1.6.0.6




More information about the lvm-devel mailing list