mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
vgcfgrestore: Retain allocatable PV attribute.
pvchange -xn was getting lost. All PVs were set to allocatable again after restore. Moved setting ALLOCATABLE_PV outside pv_setup().
This commit is contained in:
parent
9e9c757541
commit
01228b692b
@ -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).
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user