diff --git a/WHATS_NEW b/WHATS_NEW index 5dcc46209..a106604c0 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.45 - =================================== + Fix pvs segfault when pv mda attributes requested for not available PV. Add support for ext4 resize in fsadm Move locking_type reading inside init_locking(). Rename get_vgs() to get_vgnames() and clarify related error messages. diff --git a/lib/report/report.c b/lib/report/report.c index 8439b2b09..729ac4899 100644 --- a/lib/report/report.c +++ b/lib/report/report.c @@ -868,15 +868,14 @@ static int _pvmdafree_disp(struct dm_report *rh, struct dm_pool *mem, const char *pvid = (const char *)(&((struct id *) data)->uuid); struct metadata_area *mda; - info = info_from_pvid(pvid, 0); - - dm_list_iterate_items(mda, &info->mdas) { - if (!mda->ops->mda_free_sectors) - continue; - mda_free = mda->ops->mda_free_sectors(mda); - if (mda_free < freespace) - freespace = mda_free; - } + if ((info = info_from_pvid(pvid, 0))) + dm_list_iterate_items(mda, &info->mdas) { + if (!mda->ops->mda_free_sectors) + continue; + mda_free = mda->ops->mda_free_sectors(mda); + if (mda_free < freespace) + freespace = mda_free; + } if (freespace == UINT64_MAX) freespace = UINT64_C(0); @@ -908,13 +907,12 @@ static int _pvmdasize_disp(struct dm_report *rh, struct dm_pool *mem, const void *data, void *private) { struct lvmcache_info *info; - uint64_t min_mda_size; + uint64_t min_mda_size = 0; const char *pvid = (const char *)(&((struct id *) data)->uuid); - info = info_from_pvid(pvid, 0); - /* PVs could have 2 mdas of different sizes (rounding effect) */ - min_mda_size = _find_min_mda_size(&info->mdas); + if ((info = info_from_pvid(pvid, 0))) + min_mda_size = _find_min_mda_size(&info->mdas); return _size64_disp(rh, mem, field, &min_mda_size, private); }