mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
report: fix pvs -o pv_free reporting for PVs with 0 PEs
[0] raw/~ # lsblk -o NAME,SIZE /dev/sda NAME SIZE sda 128M [0] raw/~ # pvcreate --dataalignment 128m /dev/sda Physical volume "/dev/sda" successfully created [0] raw/~ # vgcreate vg /dev/sda Volume group "vg" successfully created [0] raw/~ # lvcreate -l1 vg Volume group "vg" has insufficient free space (0 extents): 1 required. Before this patch: [0] raw/~ # pvs -o pv_name,pv_free PV PFree /dev/sda 128.00m After this patch: [0] raw/~ # pvs -o pv_name,pv_free PV PFree /dev/sda 0
This commit is contained in:
parent
e566faaae6
commit
722ca363f0
@ -1,5 +1,6 @@
|
|||||||
Version 2.02.99 -
|
Version 2.02.99 -
|
||||||
===================================
|
===================================
|
||||||
|
Fix pvs -o pv_free reporting for PVs with zero PE count.
|
||||||
Fix missing cleanup of flags when the LV is detached from pool.
|
Fix missing cleanup of flags when the LV is detached from pool.
|
||||||
Fix check for some forbidden discards conversion of thin pools.
|
Fix check for some forbidden discards conversion of thin pools.
|
||||||
Add pool_is_active() to check for any pool related active LV.
|
Add pool_is_active() to check for any pool related active LV.
|
||||||
|
@ -106,7 +106,7 @@ uint64_t pv_free(const struct physical_volume *pv)
|
|||||||
{
|
{
|
||||||
uint64_t freespace;
|
uint64_t freespace;
|
||||||
|
|
||||||
if (!pv->pe_count)
|
if (!pv->vg || is_orphan_vg(pv->vg->name))
|
||||||
freespace = pv->size;
|
freespace = pv->size;
|
||||||
else
|
else
|
||||||
freespace = (uint64_t)
|
freespace = (uint64_t)
|
||||||
|
Loading…
Reference in New Issue
Block a user