1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

lvmetad: fix memleak when pv changes it device

Test vgimportclone invokes mem leak of pvid which
would be otherwise lost when device_old_pvid
is removed from hash table.
This commit is contained in:
Zdenek Kabelac 2014-03-01 11:36:05 +01:00
parent c8e868f6e0
commit d8513da9be
2 changed files with 2 additions and 0 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.106 -
====================================
Fix memleak when lvmetad discovers PV to appear on another device.
Fix calculation of maximum size of COW device for snapshot (2.02.99).
Do not allow stripe size to be bigger then extent size for lvresize.
Zero snapshot COW header when creating read-only snapshot.

View File

@ -908,6 +908,7 @@ static response pv_found(lvmetad_state *s, request r)
if (pvmeta_old_pvid && device != device_old_pvid) {
DEBUGLOG(s, "pv %s no longer on device %" PRIu64, pvid, device_old_pvid);
dm_free(dm_hash_lookup_binary(s->device_to_pvid, &device_old_pvid, sizeof(device_old_pvid)));
dm_hash_remove_binary(s->device_to_pvid, &device_old_pvid, sizeof(device_old_pvid));
}