mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-09 12:58:41 +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:
parent
45b7322488
commit
01df2cf464
@ -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
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user