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.
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;
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;