From: David Teigland Date: Tue, 3 Sep 2019 15:07:56 +0000 (-0500) Subject: vgextend: check missing device during block size check X-Git-Tag: v2_03_06~145 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=98d420200e16b450b6b7e33b83bdf36a59196d6d;p=lvm2.git vgextend: check missing device during block size check Checking the block size when a device is missing could trigger a segfault. --- diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c index 6d21ff99c..61906cc4b 100644 --- a/lib/metadata/metadata.c +++ b/lib/metadata/metadata.c @@ -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;