[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

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



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 <dwysocha 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.5


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]