1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

cleanup: add extra internal error

Ensure the target line will work only with segment with pool.
This commit is contained in:
Zdenek Kabelac 2013-06-14 09:51:09 +02:00
parent a040dd8cfb
commit 0240521942

View File

@ -493,6 +493,11 @@ static int _thin_add_target_line(struct dev_manager *dm,
char *pool_dlid, *external_dlid; char *pool_dlid, *external_dlid;
uint32_t device_id = seg->device_id; uint32_t device_id = seg->device_id;
if (!seg->pool_lv) {
log_error(INTERNAL_ERROR "Segment %s has no pool.",
seg->lv->name);
return 0;
}
if (!(pool_dlid = build_dm_uuid(mem, seg->pool_lv->lvid.s, lv_layer(seg->pool_lv)))) { if (!(pool_dlid = build_dm_uuid(mem, seg->pool_lv->lvid.s, lv_layer(seg->pool_lv)))) {
log_error("Failed to build uuid for pool LV %s.", log_error("Failed to build uuid for pool LV %s.",
seg->pool_lv->name); seg->pool_lv->name);