diff --git a/WHATS_NEW b/WHATS_NEW index aff000fa9..885226aed 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.140 - =================================== + Fix vgcfgrestore to respect allocatable attribute of PVs. Add report/mark_hidden_devices to lvm.conf. Use brackets consistently in report fields to mark hidden devices. Restore background polling processing during auto-activation (2.02.119). diff --git a/lib/format1/format1.c b/lib/format1/format1.c index 1b86ef5d6..c717184fa 100644 --- a/lib/format1/format1.c +++ b/lib/format1/format1.c @@ -383,7 +383,6 @@ static int _format1_pv_setup(const struct format_type *fmt, struct physical_volume *pv, struct volume_group *vg) { - int r; struct pvcreate_restorable_params rp = {.restorefile = NULL, .id = {{0}}, .idp = NULL, @@ -393,10 +392,7 @@ static int _format1_pv_setup(const struct format_type *fmt, .extent_count = 0, .extent_size = vg->extent_size}; - if ((r = _format1_pv_initialise(fmt, -1, 0, 0, &rp, pv))) - pv->status |= ALLOCATABLE_PV; - - return r; + return _format1_pv_initialise(fmt, -1, 0, 0, &rp, pv); } static int _format1_lv_setup(struct format_instance *fid, struct logical_volume *lv) diff --git a/lib/format_text/format-text.c b/lib/format_text/format-text.c index 9aad0fe97..02d345954 100644 --- a/lib/format_text/format-text.c +++ b/lib/format_text/format-text.c @@ -1818,10 +1818,6 @@ static int _text_pv_setup(const struct format_type *fmt, pv->pe_count = (uint32_t) pe_count; } - /* Unlike LVM1, we don't store this outside a VG */ - /* FIXME Default from config file? vgextend cmdline flag? */ - pv->status |= ALLOCATABLE_PV; - return 1; } diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c index a1d2e2b49..0336d5d82 100644 --- a/lib/metadata/metadata.c +++ b/lib/metadata/metadata.c @@ -227,6 +227,10 @@ int add_pv_to_vg(struct volume_group *vg, const char *pv_name, */ pv->pe_alloc_count = 0; + /* LVM1 stores this outside a VG; LVM2 only stores it inside */ + /* FIXME Default from config file? vgextend cmdline flag? */ + pv->status |= ALLOCATABLE_PV; + if (!fid->fmt->ops->pv_setup(fid->fmt, pv, vg)) { log_error("Format-specific setup of physical volume '%s' " "failed.", pv_name);