]> sourceware.org Git - lvm2.git/commitdiff
lvm1: Fail vg_write graciously when devices are missing.
authorPetr Rockai <prockai@redhat.com>
Sun, 8 Jun 2014 19:52:54 +0000 (21:52 +0200)
committerPetr Rockai <prockai@redhat.com>
Sun, 8 Jun 2014 19:57:18 +0000 (21:57 +0200)
lib/format1/disk-rep.c
test/shell/lvmetad-lvm1.sh

index f42d344cfeed4556591565e62bf1e7364e8fcb27..32e9f5e28c1e041ba61be922c7a22f3001d85d4f 100644 (file)
@@ -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;
 
index 814134c811110eab4f6a8a3cf7de38476ac5b2cf..d41e0784a2962c3d8d40cbd13a34462d9e2281cd 100644 (file)
@@ -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
This page took 0.035652 seconds and 5 git commands to generate.