diff --git a/lib/format1/disk-rep.c b/lib/format1/disk-rep.c index f42d344cf..32e9f5e28 100644 --- a/lib/format1/disk-rep.c +++ b/lib/format1/disk-rep.c @@ -727,6 +727,9 @@ static int _write_all_pvd(const struct format_type *fmt, struct disk_list *data, { int r; + if (!data->dev) + return_0; + if (!dev_open(data->dev)) return_0; diff --git a/test/shell/lvmetad-lvm1.sh b/test/shell/lvmetad-lvm1.sh index 814134c81..d41e0784a 100644 --- a/test/shell/lvmetad-lvm1.sh +++ b/test/shell/lvmetad-lvm1.sh @@ -20,3 +20,12 @@ vgcreate --metadatatype 1 $vg1 "$dev1" should vgscan --cache vgs | should grep $vg1 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