mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Always free hash table
also in error path
This commit is contained in:
parent
2caa558e7c
commit
0fc9a3dce3
@ -1,5 +1,6 @@
|
||||
Version 2.02.96 -
|
||||
================================
|
||||
Always free hash table on update_pvid_to_vgid() in lvmetad.
|
||||
Update and fix monitoring of thin pool devices.
|
||||
Check hash insert success in lock_vg clvmd.
|
||||
Check for buffer overwrite in get_cluster_type() clvmd.
|
||||
|
@ -622,6 +622,7 @@ static int update_pvid_to_vgid(lvmetad_state *s, struct dm_config_tree *vg,
|
||||
const char *pvid;
|
||||
const char *vgid_old;
|
||||
const char *check_vgid;
|
||||
int r = 0;
|
||||
|
||||
if (!vgid)
|
||||
return 0;
|
||||
@ -636,10 +637,10 @@ static int update_pvid_to_vgid(lvmetad_state *s, struct dm_config_tree *vg,
|
||||
if (nuke_empty &&
|
||||
(vgid_old = dm_hash_lookup(s->pvid_to_vgid, pvid)) &&
|
||||
!dm_hash_insert(to_check, vgid_old, (void*) 1))
|
||||
return 0;
|
||||
goto out;
|
||||
|
||||
if (!dm_hash_insert(s->pvid_to_vgid, pvid, (void*) vgid))
|
||||
return 0;
|
||||
goto out;
|
||||
|
||||
debug("remap PV %s to VG %s\n", pvid, vgid);
|
||||
}
|
||||
@ -652,9 +653,11 @@ static int update_pvid_to_vgid(lvmetad_state *s, struct dm_config_tree *vg,
|
||||
unlock_vg(s, check_vgid);
|
||||
}
|
||||
|
||||
r = 1;
|
||||
out:
|
||||
dm_hash_destroy(to_check);
|
||||
|
||||
return 1;
|
||||
return r;
|
||||
}
|
||||
|
||||
/* A pvid map lock needs to be held if update_pvids = 1. */
|
||||
|
Loading…
Reference in New Issue
Block a user