From 02405219424619a56e7e3a3619e157f942e4fdb4 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Fri, 14 Jun 2013 09:51:09 +0200 Subject: [PATCH] cleanup: add extra internal error Ensure the target line will work only with segment with pool. --- lib/thin/thin.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/thin/thin.c b/lib/thin/thin.c index d1ffd27a5..116b7e109 100644 --- a/lib/thin/thin.c +++ b/lib/thin/thin.c @@ -493,6 +493,11 @@ static int _thin_add_target_line(struct dev_manager *dm, char *pool_dlid, *external_dlid; 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)))) { log_error("Failed to build uuid for pool LV %s.", seg->pool_lv->name);