From df5021a2017e395c68d1bee012a54a1d59c63c90 Mon Sep 17 00:00:00 2001 From: Heinz Mauelshagen Date: Wed, 13 Jul 2016 15:16:23 +0200 Subject: [PATCH] lv_manip: extension of raid0 causes livelock A livelock occurs on extension in lv_manip when adjusting the region size, which doesn't apply to any raid0/raid0_meta LVs (these don't have a bitmap). Fix by prohibiting the region size adjustment on any such LVs. - resolves rhbz1354604 --- lib/metadata/lv_manip.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c index 5cf96181b..d11b1259f 100644 --- a/lib/metadata/lv_manip.c +++ b/lib/metadata/lv_manip.c @@ -3921,14 +3921,16 @@ static int _lv_extend_layered_lv(struct alloc_handle *ah, /* * The MD bitmap is limited to being able to track 2^21 regions. - * The region_size must be adjusted to meet that criteria. + * The region_size must be adjusted to meet that criteria + * unless raid0/raid0_meta, which doesn't have a bitmap. */ - while (seg_is_raid(seg) && (seg->region_size < (lv->size / (1 << 21)))) { - seg->region_size *= 2; - log_very_verbose("Adjusting RAID region_size from %uS to %uS" - " to support large LV size", - seg->region_size/2, seg->region_size); - } + if (seg_is_raid(seg) && !seg_is_any_raid0(seg)) + while (seg->region_size < (lv->size / (1 << 21))) { + seg->region_size *= 2; + log_very_verbose("Adjusting RAID region_size from %uS to %uS" + " to support large LV size", + seg->region_size/2, seg->region_size); + } return 1; }