master - lvmetad: Fix vgname->vgid hash updates w/ duplicate VG names.
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=0d03503a453f91cee09fb3a1664d2136d58ac751 Commit: 0d03503a453f91cee09fb3a1664d2136d58ac751 Parent: a7ff7aee4f49015db03536bbaee13b9795d63e6c Author: Petr Rockai <[email protected]> AuthorDate: Fri Oct 4 14:30:00 2013 +0200 Committer: Petr Rockai <[email protected]> CommitterDate: Fri Oct 4 14:31:45 2013 +0200
lvmetad: Fix vgname->vgid hash updates w/ duplicate VG names.
--- daemons/lvmetad/lvmetad-core.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-)
daemons/lvmetad/lvmetad-core.c +5 -2
@@ -753,8 +753,11 @@ static int update_metadata(lvmetad_state *s, const char *name, const char *_vgiddm_hash_insert (s->vgid_to_vgname, vgid, cfgname) && dm_hash_insert(s->vgname_to_vgid, name, (void*) vgid)) ? 1 : 0; -if (retval && oldname &&strcmp (name, oldname)) -dm_hash_remove (s->vgname_to_vgid, oldname); +if (retval && oldname &&strcmp (name, oldname)) { +const char *vgid_prev =dm_hash_lookup (s->vgname_to_vgid, oldname); +if (vgid_prev && !strcmp (vgid_prev, vgid)) +dm_hash_remove (s->vgname_to_vgid, oldname); + }if (haveseq >=0 && haveseq < seq)dm_config_destroy (old);