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

Extend allocation areas to avoid overflow with contiguous with other PVs.

Another pvmove fix.
This commit is contained in:
Alasdair Kergon 2005-11-10 14:45:39 +00:00
parent 47b59176e0
commit b79c897ea1
3 changed files with 8 additions and 2 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.00 - Version 2.02.00 -
=================================== ===================================
Extend allocation areas to avoid overflow with contiguous with other PVs.
Stop lvcreate attempting to wipe zero or error segments. Stop lvcreate attempting to wipe zero or error segments.
Added new lvs table attributes. Added new lvs table attributes.
Separated out activation preload. Separated out activation preload.

View File

@ -718,7 +718,7 @@ static int _find_parallel_space(struct alloc_handle *ah, alloc_policy_t alloc,
already_found_one = 1; already_found_one = 1;
} }
areas[ix + ix_offset -1] = pva; areas[ix + ix_offset - 1] = pva;
break; /* Next PV */ break; /* Next PV */
} }
@ -811,6 +811,11 @@ static int _allocate(struct alloc_handle *ah,
areas_size = ah->area_count + ah->log_count; areas_size = ah->area_count + ah->log_count;
} }
/* Upper bound if none of the PVs in prev_lvseg is in pvms */
/* FIXME Work size out properly */
if (prev_lvseg)
areas_size += prev_lvseg->area_count;
/* Allocate an array of pv_areas to hold the largest space on each PV */ /* Allocate an array of pv_areas to hold the largest space on each PV */
if (!(areas = dm_malloc(sizeof(*areas) * areas_size))) { if (!(areas = dm_malloc(sizeof(*areas) * areas_size))) {
log_err("Couldn't allocate areas array."); log_err("Couldn't allocate areas array.");

View File

@ -309,7 +309,7 @@ static int _add_target_line(struct dev_manager *dm, struct dm_pool *mem,
} }
done: done:
return add_areas_line(dm, seg, node, start_area, seg->area_count); return add_areas_line(dm, seg, node, start_area, area_count);
} }
static int _target_present(void) static int _target_present(void)