mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-02 01:18:26 +03:00
Call destroy_instance for any PVs found in VG structure during vg_free call.
This is necessary for proper format instance ref_count support. We iterate over vg->pvs and vg->removed_pvs list and the ref_count is decremented and then it is destroyed if not referenced anymore.
This commit is contained in:
parent
84f48499a3
commit
2feb2a66fd
@ -1,5 +1,6 @@
|
|||||||
Version 2.02.85 -
|
Version 2.02.85 -
|
||||||
===================================
|
===================================
|
||||||
|
Call destroy_instance for any PVs found in VG structure during vg_free call.
|
||||||
Add new free_pv_fid fn and use it throughout to free all attached fids.
|
Add new free_pv_fid fn and use it throughout to free all attached fids.
|
||||||
Use only vg_set_fid and new pv_set_fid fn to assign the format instance.
|
Use only vg_set_fid and new pv_set_fid fn to assign the format instance.
|
||||||
Make create_text_context fn static and move it inside create_instance fn.
|
Make create_text_context fn static and move it inside create_instance fn.
|
||||||
|
@ -3243,9 +3243,20 @@ void free_pv_fid(struct physical_volume *pv)
|
|||||||
|
|
||||||
void free_vg(struct volume_group *vg)
|
void free_vg(struct volume_group *vg)
|
||||||
{
|
{
|
||||||
|
struct pv_list *pvl;
|
||||||
|
|
||||||
if (!vg)
|
if (!vg)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
dm_list_iterate_items(pvl, &vg->pvs)
|
||||||
|
pvl->pv->fid->fmt->ops->destroy_instance(pvl->pv->fid);
|
||||||
|
|
||||||
|
dm_list_iterate_items(pvl, &vg->removed_pvs)
|
||||||
|
pvl->pv->fid->fmt->ops->destroy_instance(pvl->pv->fid);
|
||||||
|
|
||||||
|
if (vg->fid)
|
||||||
|
vg->fid->fmt->ops->destroy_instance(vg->fid);
|
||||||
|
|
||||||
if (vg->cmd && vg->vgmem == vg->cmd->mem) {
|
if (vg->cmd && vg->vgmem == vg->cmd->mem) {
|
||||||
log_error(INTERNAL_ERROR "global memory pool used for VG %s",
|
log_error(INTERNAL_ERROR "global memory pool used for VG %s",
|
||||||
vg->name);
|
vg->name);
|
||||||
|
Loading…
Reference in New Issue
Block a user