1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-27 18:55:19 +03:00

Have a pe_total check using theoretically big number instead of the

unnecessarily small limit LVM1 imposes in vgcreate (but not vgextend)
This commit is contained in:
Alasdair Kergon 2002-01-24 23:35:56 +00:00
parent c50c2886f7
commit 3d2d379ce4
2 changed files with 10 additions and 0 deletions

View File

@ -22,6 +22,8 @@
#define MAX_PE_SIZE ( 16L * 1024L * 1024L / SECTOR_SIZE * 1024)
#define PE_SIZE_PV_SIZE_REL 5 /* PV size must be at least 5 times PE size */
#define MAX_LE_TOTAL ( ( 1 << ( sizeof ( uint16_t) * 8)) - 2)
#define MAX_PE_TOTAL ( ( uint32_t) (-2) )
#define UNMAPPED_EXTENT 0

View File

@ -147,6 +147,14 @@ int calculate_extent_count(struct physical_volume *pv)
} while((pvd->pe_start + (pvd->pe_total * pv->pe_size)) > pv->size);
if (pvd->pe_total > MAX_PE_TOTAL) {
log_error("Metadata extent limit (%u) exceeded for %s - "
"%u required", MAX_PE_TOTAL, dev_name(pv->dev),
pvd->pe_total);
dbg_free(pvd);
return 0;
}
pv->pe_count = pvd->pe_total;
pv->pe_start = pvd->pe_start;
dbg_free(pvd);