dev-mornfall-lvmcache - fid: fix reset of PV fid
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=2f1a571c9707d596d7716cec9488e54ba4c0c946 Commit: 2f1a571c9707d596d7716cec9488e54ba4c0c946 Parent: 55f42944bd76ffdf3f77331c491e7de24ed56a2f Author: Zdenek Kabelac <[email protected]> AuthorDate: Wed May 29 12:42:09 2013 +0200 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Thu May 30 16:52:39 2013 +0200
fid: fix reset of PV fid
Avoid hitting memory corruption (double free) in code path, where PV FID has been already destroyed and the released pointer was left in PV structure and could have been tried to be released from there 2nd. time with final context destruction.
--- WHATS_NEW | 1 + lib/metadata/metadata.c | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-)
WHATS_NEW +1 -0
@@ -1,5 +1,6 @@ Version 2.02.99 - =================================== + Fix release of PV's fid in free_pv_fid(). Skip monitoring of snapshots that are already bigger then origin. Add lv_is_cow_covering_origin() to check if cow covers origin size. Use libdm dm_get_status_snapshot() to parse snapshot status.
lib/metadata/metadata.c +1 -2
@@ -3402,8 +3402,7 @@ void free_pv_fid(struct physical_volume *pv)if (!pv)return ; -if (pv->fid) - pv->fid->fmt->ops->destroy_instance (pv->fid); +pv_set_fid (pv,NULL ); }/* This is only called by lv_from_lvid, which is only called from