diff --git a/lib/format1/disk-rep.h b/lib/format1/disk-rep.h index 1d850b88a..7072c963e 100644 --- a/lib/format1/disk-rep.h +++ b/lib/format1/disk-rep.h @@ -21,7 +21,7 @@ #define MIN_PE_SIZE ( 8192L / SECTOR_SIZE) /* 8 KB in sectors */ #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_PE_TOTAL ( ( 1 << ( sizeof ( uint16_t) * 8)) - 2) +#define MAX_LE_TOTAL ( ( 1 << ( sizeof ( uint16_t) * 8)) - 2) #define UNMAPPED_EXTENT 0 diff --git a/lib/format1/format1.c b/lib/format1/format1.c index 50bbb6719..e9b410f15 100644 --- a/lib/format1/format1.c +++ b/lib/format1/format1.c @@ -358,9 +358,9 @@ static int _pv_setup(struct format_instance *fi, struct physical_volume *pv, static int _lv_setup(struct format_instance *fi, struct logical_volume *lv) { - if (lv->le_count > 65534UL) { + if (lv->le_count > MAX_LE_TOTAL) { log_err("Format 1 logical volumes cannot contain more than " - "65534 extents."); + "%d extents.", MAX_LE_TOTAL); return 0; } diff --git a/lib/format1/layout.c b/lib/format1/layout.c index 5e0f00fce..323f71972 100644 --- a/lib/format1/layout.c +++ b/lib/format1/layout.c @@ -147,14 +147,6 @@ 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);