1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

allocation: Fix alloc anywhere with parity.

Take account of parity areas with alloc anywhere in
_calc_required_extents.  Extents beyond area_count were treated
incorrectly as mirror logs.
This commit is contained in:
Alasdair G Kergon 2014-05-14 16:25:43 +01:00
parent 422b3b0fb5
commit 3b989e317f
2 changed files with 3 additions and 3 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.107 -
==================================
Take account of parity areas with alloc anywhere in _calc_required_extents.
Use proper uint64 casting for calculation of cache metadata size.
Better support for nesting of blocking signals.
Use only sigaction handler and drop duplicate signal handler.

View File

@ -1432,8 +1432,7 @@ static int _alloc_parallel_area(struct alloc_handle *ah, uint32_t max_to_allocat
struct alloced_area *aa;
struct pv_area *pva;
total_area_count = ah->area_count + alloc_state->log_area_count_still_needed;
total_area_count += ah->parity_count;
total_area_count = ah->area_count + ah->parity_count + alloc_state->log_area_count_still_needed;
if (!total_area_count) {
log_warn(INTERNAL_ERROR "_alloc_parallel_area called without any allocation to do.");
return 1;
@ -1980,7 +1979,7 @@ static uint32_t _calc_required_extents(struct alloc_handle *ah, struct pv_area *
* reduce amount we're looking for.
*/
if (alloc == ALLOC_ANYWHERE) {
if (ix_pva >= ah->area_count)
if (ix_pva >= ah->area_count + ah->parity_count)
required = ah->log_len;
} else if (required < ah->log_len)
required = ah->log_len;