From 32d6ca9196591d7f4d820e373fd14fd0f2301914 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Wed, 26 Aug 2015 14:14:44 +0200 Subject: [PATCH] cleanup: show error message Add error message on error path. --- lib/metadata/raid_manip.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c index 8ecdc02d3..118bd06cf 100644 --- a/lib/metadata/raid_manip.c +++ b/lib/metadata/raid_manip.c @@ -397,8 +397,10 @@ static struct logical_volume *_alloc_image_component(struct logical_volume *lv, } if (dm_snprintf(img_name, sizeof(img_name), "%s_%s_%%d", - (alt_base_name) ? : lv->name, type_suffix) < 0) - return_0; + (alt_base_name) ? : lv->name, type_suffix) < 0) { + log_error("Component name for raid %s is too long.", lv->name); + return 0; + } status = LVM_READ | LVM_WRITE | LV_REBUILD | type; if (!(tmp_lv = lv_create_empty(img_name, NULL, status, ALLOC_INHERIT, lv->vg))) { -- 2.43.5