1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-07-30 23:41:55 +03:00

Show 'not usable' space when PV is too large for device in pvdisplay.

Ignore and fix up any excessive device size found in metadata.
This commit is contained in:
Alasdair Kergon
2007-11-05 01:47:49 +00:00
parent 2b0249ec42
commit fd4ff5d201
4 changed files with 20 additions and 16 deletions

View File

@ -95,8 +95,8 @@ int import_pv(const struct format_type *fmt, struct dm_pool *mem,
pv->pe_count = pvd->pe_total;
pv->pe_alloc_count = 0;
/* Fix up pv size if missing */
if (!pv->size) {
/* Fix up pv size if missing or impossibly large */
if (!pv->size || pv->size > (1ULL << 62)) {
if (!dev_get_size(dev, &pv->size)) {
log_error("%s: Couldn't get size.", pv_dev_name(pv));
return 0;