1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

metadata: fix regression causing PVs not in VGs to be marked as allocatable

If the PV is not yet in a VG, it's not allocatable.
A regression introduced by commit 0283c439ec
(_pv_create) and later commit a7ca101517
(pv_read).
This commit is contained in:
Peter Rajnoha 2014-07-07 13:58:42 +02:00
parent 7021c8f1a4
commit 6dc7b783c8
3 changed files with 12 additions and 1 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.108 -
=================================
Fix regression causing PVs not in VGs to be marked as allocatable (2.02.59).
Fix VG component of lvid in vgsplit/vgmerge and check in vg_validate.
Add lv_full_name, lv_parent and lv_dm_path fields to reports.
Change lv_path field to suppress devices that never appear in /dev/vg.

View File

@ -1599,7 +1599,6 @@ static struct physical_volume *_alloc_pv(struct dm_pool *mem, struct device *dev
}
pv->dev = dev;
pv->status = ALLOCATABLE_PV;
dm_list_init(&pv->tags);
dm_list_init(&pv->segments);

View File

@ -19,6 +19,17 @@ check_changed_uuid_() {
aux prepare_pvs 4
# check 'allocatable' pv attribute
pvcreate $dev1
check pv_field "$dev1" pv_attr ---
vgcreate $vg1 "$dev1"
check pv_field "$dev1" pv_attr a--
pvchange --allocatable n "$dev1"
check pv_field "$dev1" pv_attr ---
vgremove -ff $vg1
not pvchange --allocatable y "$dev1"
pvremove -ff "$dev1"
for mda in 0 1 2
do
# "setup pv with metadatacopies = $mda"