]> sourceware.org Git - lvm2.git/commitdiff
vgextend: check missing device during block size check
authorDavid Teigland <teigland@redhat.com>
Tue, 3 Sep 2019 15:07:56 +0000 (10:07 -0500)
committerDavid Teigland <teigland@redhat.com>
Tue, 3 Sep 2019 15:07:56 +0000 (10:07 -0500)
Checking the block size when a device is missing could
trigger a segfault.

lib/metadata/metadata.c

index 6d21ff99cc8ef9d90c34d475a8d349195d6080d5..61906cc4b352db2dce22599f79bbb50d825c6623 100644 (file)
@@ -769,6 +769,9 @@ int vg_extend_each_pv(struct volume_group *vg, struct pvcreate_params *pp)
                logical_block_size = 0;
                physical_block_size = 0;
 
+               if (!pvl->pv->dev)
+                       continue;
+
                if (!dev_get_direct_block_sizes(pvl->pv->dev, &physical_block_size, &logical_block_size))
                        continue;
 
This page took 0.038205 seconds and 5 git commands to generate.