1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-18 10:04:20 +03:00

Check result of vginfo_from_vgname

Check for some potential internal error.
This commit is contained in:
Zdenek Kabelac 2010-12-01 10:39:28 +00:00
parent 1d2f212a3d
commit e3552d738c
2 changed files with 8 additions and 0 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.78 - Version 2.02.78 -
==================================== ====================================
Add test for existance of orphan vginfo in _lvmcache_update_vgname().
Do a full rescan if some device is missing in read_pvs_in_vg(). Do a full rescan if some device is missing in read_pvs_in_vg().
Avoid misleading warnings in vgextend --restoremissing in certain cases. Avoid misleading warnings in vgextend --restoremissing in certain cases.
Add error path stack traces for _process_mapper_dir(), _create_and_load_v4(). Add error path stack traces for _process_mapper_dir(), _create_and_load_v4().

View File

@ -1083,6 +1083,13 @@ static int _lvmcache_update_vgname(struct lvmcache_info *info,
_scanning_in_progress && _vginfo_is_invalid(primary_vginfo)) _scanning_in_progress && _vginfo_is_invalid(primary_vginfo))
dm_list_iterate_items_safe(info2, info3, &primary_vginfo->infos) { dm_list_iterate_items_safe(info2, info3, &primary_vginfo->infos) {
orphan_vginfo = vginfo_from_vgname(primary_vginfo->fmt->orphan_vg_name, NULL); orphan_vginfo = vginfo_from_vgname(primary_vginfo->fmt->orphan_vg_name, NULL);
if (!orphan_vginfo) {
log_error(INTERNAL_ERROR "Orphan vginfo %s lost from cache.",
primary_vginfo->fmt->orphan_vg_name);
dm_free(vginfo->vgname);
dm_free(vginfo);
return 0;
}
_drop_vginfo(info2, primary_vginfo); _drop_vginfo(info2, primary_vginfo);
_vginfo_attach_info(orphan_vginfo, info2); _vginfo_attach_info(orphan_vginfo, info2);
if (info2->mdas.n) if (info2->mdas.n)