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

vgcfgrestore: check for missing device

The missing device will generally be seen earlier
and cause the command to not reach this point, but
check anyway for completeness.
This commit is contained in:
David Teigland 2016-06-20 16:02:07 -05:00
parent 47a29f6b2e
commit f96de67490

View File

@ -339,6 +339,11 @@ static int _restore_vg_should_write_pv(struct physical_volume *pv, int do_pvcrea
if (!(pv->fmt->features & FMT_PV_FLAGS))
return 0;
if (!pv->dev) {
log_error("Failed to find device for PV.");
return -1;
}
if (!(info = lvmcache_info_from_pvid(pv->dev->pvid, pv->dev, 0))) {
log_error("Failed to find cached info for PV %s.", pv_dev_name(pv));
return -1;