mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Fix a possible SEGV in lvmetad client code, and a minor leak in pvscan
--lvmetad.
This commit is contained in:
parent
6857e761cf
commit
7e9fbf5518
7
lib/cache/lvmetad.c
vendored
7
lib/cache/lvmetad.c
vendored
@ -566,9 +566,10 @@ static int _pvscan_lvmetad_single(struct metadata_area *mda, void *baton)
|
||||
{
|
||||
struct _pvscan_lvmetad_baton *b = baton;
|
||||
struct volume_group *this = mda->ops->vg_read(b->fid, "", mda);
|
||||
if ((this && !b->vg) || this->seqno > b->vg->seqno)
|
||||
if (!b->vg || this->seqno > b->vg->seqno)
|
||||
b->vg = this;
|
||||
else release_vg(this);
|
||||
else if (b->vg)
|
||||
release_vg(this);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -647,6 +648,8 @@ int pvscan_lvmetad(struct cmd_context *cmd, int argc, char **argv)
|
||||
&fic);
|
||||
|
||||
lvmcache_foreach_mda(info, _pvscan_lvmetad_single, &baton);
|
||||
if (!baton.vg)
|
||||
lvmcache_fmt(info)->ops->destroy_instance(baton.fid);
|
||||
|
||||
/*
|
||||
* NB. If this command failed and we are relying on lvmetad to have an
|
||||
|
Loading…
Reference in New Issue
Block a user