mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Fix pvs segfault when pv mda attributes requested for not available PV.
This commit is contained in:
parent
cd96532e78
commit
92a4d6b28a
@ -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.
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user