mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-22 17:35:59 +03:00
clvmd: fix leak of saved_vg struct
Commit c016b573ee
"clvmd: separate saved_vg from vginfo"
created a separate hash table for the saved_vg structs.
The vg's referenced by the saved_vg struct were all being
freed properly, but the svg wrapper struct itself was not
being freed.
This commit is contained in:
parent
bfb904af1c
commit
76075ff55d
6
lib/cache/lvmcache.c
vendored
6
lib/cache/lvmcache.c
vendored
@ -295,6 +295,11 @@ static void _drop_metadata(const char *vgname, int drop_precommitted)
|
|||||||
_saved_vg_free(svg, 0, 1);
|
_saved_vg_free(svg, 0, 1);
|
||||||
else
|
else
|
||||||
_saved_vg_free(svg, 1, 1);
|
_saved_vg_free(svg, 1, 1);
|
||||||
|
|
||||||
|
if (!svg->saved_vg_old && !svg->saved_vg_new) {
|
||||||
|
dm_hash_remove(_saved_vg_hash, svg->vgid);
|
||||||
|
dm_free(svg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void lvmcache_save_vg(struct volume_group *vg, int precommitted)
|
void lvmcache_save_vg(struct volume_group *vg, int precommitted)
|
||||||
@ -2515,6 +2520,7 @@ static void _lvmcache_destroy_lockname(struct dm_hash_node *n)
|
|||||||
static void _destroy_saved_vg(struct saved_vg *svg)
|
static void _destroy_saved_vg(struct saved_vg *svg)
|
||||||
{
|
{
|
||||||
_saved_vg_free(svg, 1, 1);
|
_saved_vg_free(svg, 1, 1);
|
||||||
|
dm_free(svg);
|
||||||
}
|
}
|
||||||
|
|
||||||
void lvmcache_destroy(struct cmd_context *cmd, int retain_orphans, int reset)
|
void lvmcache_destroy(struct cmd_context *cmd, int retain_orphans, int reset)
|
||||||
|
Loading…
Reference in New Issue
Block a user