diff --git a/WHATS_NEW b/WHATS_NEW index 33993e45c..82cbfc93d 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.99 - =================================== + Fix PV alignment to incorporate alignment offset if the PV has zero MDAs. Allow remove/replace of RAID sub-LVs that are composed of error targets. Make 'vgreduce --removemissing' able to handle RAID LVs with missing PVs. Rename lvm.conf setting 'mirror_region_size' to 'raid_region_size'. diff --git a/lib/format_text/format-text.c b/lib/format_text/format-text.c index 24fd3187a..cf1531300 100644 --- a/lib/format_text/format-text.c +++ b/lib/format_text/format-text.c @@ -1508,8 +1508,14 @@ static int _text_pv_initialise(const struct format_type *fmt, return 0; } - if (pe_start == PV_PE_START_CALC && pv->pe_start < pv->pe_align) - pv->pe_start = pv->pe_align; + if (pv->size < pv->pe_align + pv->pe_align_offset) { + log_error("%s: Data alignment must not exceed device size.", + pv_dev_name(pv)); + return 0; + } + + if (pe_start == PV_PE_START_CALC) + pv->pe_start = pv->pe_align + pv->pe_align_offset; if (extent_size) pv->pe_size = extent_size; diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c index 0b774ac1f..d03b49c22 100644 --- a/lib/metadata/metadata.c +++ b/lib/metadata/metadata.c @@ -1650,7 +1650,7 @@ struct physical_volume *pv_create(const struct cmd_context *cmd, goto bad; } - if (pv->size < data_alignment) { + if (pv->size < data_alignment + data_alignment_offset) { log_error("%s: Data alignment must not exceed device size.", pv_dev_name(pv)); goto bad;