mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
pv_read: add missing check for valid info
If the lvmcache_info_from_pvid() fails to find valid info, invoke the lookup by dev, and only in this case call lvmcache_info_from_pvid() again. Also check for the result of info and return error directly, so the NULL is not passed to lvmcache_get_label().
This commit is contained in:
parent
3e8dbfaecf
commit
401c9aba4a
@ -1,5 +1,6 @@
|
||||
Version 2.02.99 -
|
||||
===================================
|
||||
Check lvmcache_info_from_pvid and recall only when needed in _pv_read.
|
||||
Check for memory failure of dm_config_write_node() in lvmetad.
|
||||
Fix socket leak on error path in lvmetad's handle_connect.
|
||||
Check for failing id_read_format() in _pv_populate_lvmcache.
|
||||
|
@ -3633,8 +3633,13 @@ static struct physical_volume *_pv_read(struct cmd_context *cmd,
|
||||
pv_name);
|
||||
return NULL;
|
||||
}
|
||||
if (!(info = lvmcache_info_from_pvid(dev->pvid, 0))) {
|
||||
if (warnings)
|
||||
log_error("No cache info in lvmetad cache for %s.",
|
||||
pv_name);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
info = lvmcache_info_from_pvid(dev->pvid, 0);
|
||||
label = lvmcache_get_label(info);
|
||||
} else {
|
||||
if (!(label_read(dev, &label, UINT64_C(0)))) {
|
||||
|
Loading…
Reference in New Issue
Block a user