mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Don't store fid in VG metadata cache to avoid clvmd segfault. (2.02.34)
This commit is contained in:
parent
657d4df010
commit
8b1ae3c140
@ -1,5 +1,6 @@
|
||||
Version 2.02.35 -
|
||||
=================================
|
||||
Don't store fid in VG metadata cache to avoid clvmd segfault. (2.02.34)
|
||||
Update vgsplit tests to verify loosening of active LV restriction.
|
||||
Update vgsplit to only restrict split with active LVs involved in split.
|
||||
Add lv_is_active() to determine whether an lv is active.
|
||||
|
10
lib/cache/lvmcache.c
vendored
10
lib/cache/lvmcache.c
vendored
@ -63,7 +63,6 @@ static void _free_cached_vgmetadata(struct lvmcache_vginfo *vginfo)
|
||||
dm_free(vginfo->vgmetadata);
|
||||
|
||||
vginfo->vgmetadata = NULL;
|
||||
vginfo->fid = NULL;
|
||||
|
||||
log_debug("Metadata cache: VG %s wiped.", vginfo->vgname);
|
||||
}
|
||||
@ -81,7 +80,6 @@ static void _store_metadata(struct lvmcache_vginfo *vginfo,
|
||||
return;
|
||||
}
|
||||
|
||||
vginfo->fid = vg->fid;
|
||||
vginfo->precommitted = precommitted;
|
||||
|
||||
log_debug("Metadata cache: VG %s stored (%d bytes%s).", vginfo->vgname,
|
||||
@ -400,6 +398,7 @@ struct volume_group *lvmcache_get_vg(const char *vgid, unsigned precommitted)
|
||||
{
|
||||
struct lvmcache_vginfo *vginfo;
|
||||
struct volume_group *vg;
|
||||
struct format_instance *fid;
|
||||
|
||||
if (!vgid || !(vginfo = vginfo_from_vgid(vgid)) || !vginfo->vgmetadata)
|
||||
return NULL;
|
||||
@ -411,7 +410,12 @@ struct volume_group *lvmcache_get_vg(const char *vgid, unsigned precommitted)
|
||||
(!precommitted && vginfo->precommitted))
|
||||
return NULL;
|
||||
|
||||
if (!(vg = import_vg_from_buffer(vginfo->vgmetadata, vginfo->fid)) ||
|
||||
fid = vginfo->fmt->ops->create_instance(vginfo->fmt, vginfo->vgname,
|
||||
vgid, NULL);
|
||||
if (!fid)
|
||||
return NULL;
|
||||
|
||||
if (!(vg = import_vg_from_buffer(vginfo->vgmetadata, fid)) ||
|
||||
!vg_validate(vg)) {
|
||||
_free_cached_vgmetadata(vginfo);
|
||||
return_NULL;
|
||||
|
1
lib/cache/lvmcache.h
vendored
1
lib/cache/lvmcache.h
vendored
@ -45,7 +45,6 @@ struct lvmcache_vginfo {
|
||||
struct lvmcache_vginfo *next; /* Another VG with same name? */
|
||||
char *creation_host;
|
||||
char *vgmetadata; /* Copy of VG metadata as format_text string */
|
||||
struct format_instance *fid; /* fid associated with vgmetadata */
|
||||
unsigned precommitted; /* Is vgmetadata live or precommitted? */
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user