if (lv_is_used_cache_pool(lv)) {
/* INFO is not set as cache-pool cannot be active.
* STATUS is collected from cache LV */
- lv_seg = get_only_segment_using_this_lv(lv);
+ if (!(lv_seg = get_only_segment_using_this_lv(lv)))
+ return_0;
(void) _lv_info(cmd, lv_seg->lv, 1, NULL, lv_seg, &status->seg_status, 0, 0);
return 1;
}
log_print("LV Pool metadata %s", seg->metadata_lv->name);
log_print("LV Pool data %s", seg_lv(seg, 0)->name);
} else if (lv_is_cache_origin(lv)) {
- log_print("LV origin of Cache LV %s",
- get_only_segment_using_this_lv(lv)->lv->name);
+ if ((seg = get_only_segment_using_this_lv(lv)))
+ log_print("LV origin of Cache LV %s", seg->lv->name);
} else if (lv_is_cache(lv)) {
seg = first_seg(lv);
if (inkernel && !lv_cache_status(lv, &cache_status))