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

lvm1: Fail vg_write graciously when devices are missing.

This commit is contained in:
Petr Rockai 2014-06-08 21:52:54 +02:00
parent 60443d6a5d
commit b3bdd41092
2 changed files with 12 additions and 0 deletions

View File

@ -727,6 +727,9 @@ static int _write_all_pvd(const struct format_type *fmt, struct disk_list *data,
{ {
int r; int r;
if (!data->dev)
return_0;
if (!dev_open(data->dev)) if (!dev_open(data->dev))
return_0; return_0;

View File

@ -20,3 +20,12 @@ vgcreate --metadatatype 1 $vg1 "$dev1"
should vgscan --cache should vgscan --cache
vgs | should grep $vg1 vgs | should grep $vg1
pvs | should grep "$dev1" pvs | should grep "$dev1"
# check for RHBZ 1080189 -- SEGV in lvremove/vgremove
pvcreate -ff -y --metadatatype 1 "$dev1" "$dev2"
vgcreate --metadatatype 1 $vg1 "$dev1" "$dev2"
lvcreate -l1 $vg1
pvremove -ff -y $dev2
vgchange -an $vg1
not lvremove $vg1
not vgremove $vg1