1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-21 22:04:19 +03:00

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
This commit is contained in:
Heinz Mauelshagen 2016-07-13 15:16:23 +02:00
parent 9c27573493
commit df5021a201

View File

@ -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;
}