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

activation: use existing LV as best effort

Returning NULL for lv_committed is basically instant crash,
so instead try with passed LV instead.
It shouldn't matter as this is internall error path anyway,
but coverity should be happier.
This commit is contained in:
Zdenek Kabelac 2021-03-09 18:23:42 +01:00
parent 15c588f931
commit 131ca0eb95

View File

@ -4335,7 +4335,7 @@ char *tags_format_and_copy(struct dm_pool *mem, const struct dm_list *tagsl)
const struct logical_volume *lv_committed(const struct logical_volume *lv)
{
struct volume_group *vg;
struct logical_volume *found_lv;
const struct logical_volume *found_lv;
if (!lv)
return NULL;
@ -4348,7 +4348,7 @@ const struct logical_volume *lv_committed(const struct logical_volume *lv)
if (!(found_lv = find_lv_in_vg_by_lvid(vg, &lv->lvid))) {
log_error(INTERNAL_ERROR "LV %s (UUID %s) not found in committed metadata.",
display_lvname(lv), lv->lvid.s);
return NULL;
found_lv = lv; /* Use uncommitted LV as best effort */
}
return found_lv;