From ddeb37f282caf053687d447cd7f52cb7d5a1f702 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Fri, 14 Dec 2012 19:42:28 +0100 Subject: [PATCH] cleanup: add internal error check Check if 'is_removable' is defined and report internal error, if it's missing. --- lib/metadata/mirror.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/metadata/mirror.c b/lib/metadata/mirror.c index 4fee76327..2a7850816 100644 --- a/lib/metadata/mirror.c +++ b/lib/metadata/mirror.c @@ -864,8 +864,13 @@ static int _remove_mirror_images(struct logical_volume *lv, s >= 0 && old_area_count - new_area_count < orig_removed; s--) { sub_lv = seg_lv(mirrored_seg, s); - if (!(is_temporary_mirror_layer(sub_lv) && lv_mirror_count(sub_lv) != 1) && - is_removable(sub_lv, removable_baton)) { + if (!(is_temporary_mirror_layer(sub_lv) && lv_mirror_count(sub_lv) != 1)) { + if (!is_removable) { + log_error(INTERNAL_ERROR "Test is_removable undefined."); + return 0; + } + if (!is_removable(sub_lv, removable_baton)) + continue; /* * Check if the user is trying to pull the * primary mirror image when the mirror is