1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

pvvmove: add a few comments

This commit is contained in:
Alasdair G Kergon 2014-06-20 11:41:20 +01:00
parent f96a499c8d
commit f29ae59a4d
2 changed files with 10 additions and 3 deletions

View File

@ -2737,8 +2737,9 @@ int lv_add_segmented_mirror_image(struct alloc_handle *ah,
} }
/* /*
* Perform any necessary segment splitting before creating * If the allocator provided two or more PV allocations for any
* the mirror layer. * single segment of the original LV, that LV segment must be
* split up to match.
*/ */
dm_list_iterate_items(aa, &ah->alloced_areas[0]) { dm_list_iterate_items(aa, &ah->alloced_areas[0]) {
if (!(seg = find_seg_by_le(lv, current_le))) { if (!(seg = find_seg_by_le(lv, current_le))) {
@ -2757,6 +2758,7 @@ int lv_add_segmented_mirror_image(struct alloc_handle *ah,
} }
current_le += seg->area_len; current_le += seg->area_len;
} }
current_le = le; current_le = le;
if (!insert_layer_for_lv(lv->vg->cmd, lv, PVMOVE, "_mimage_0")) { if (!insert_layer_for_lv(lv->vg->cmd, lv, PVMOVE, "_mimage_0")) {
@ -5222,7 +5224,7 @@ int remove_layers_for_segments(struct cmd_context *cmd,
layer_lv->name, lseg->le); layer_lv->name, lseg->le);
return 0; return 0;
} }
if (((lseg->status & status_mask) != status_mask)) { if ((lseg->status & status_mask) != status_mask) {
log_error("Layer status does not match: " log_error("Layer status does not match: "
"%s:%" PRIu32 " status: 0x%" PRIx64 "/0x%" PRIx64, "%s:%" PRIu32 " status: 0x%" PRIx64 "/0x%" PRIx64,
layer_lv->name, lseg->le, layer_lv->name, lseg->le,

View File

@ -40,6 +40,11 @@ int lv_merge_segments(struct logical_volume *lv)
struct dm_list *segh, *t; struct dm_list *segh, *t;
struct lv_segment *seg, *current, *prev = NULL; struct lv_segment *seg, *current, *prev = NULL;
/*
* Don't interfere with pvmoves as they rely upon two LVs
* having a matching segment structure.
*/
if (lv->status & LOCKED || lv->status & PVMOVE) if (lv->status & LOCKED || lv->status & PVMOVE)
return 1; return 1;