mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
pvmove: enhance delayed_resume logic
ATM we want to support delayed resume purely in pvmove case.
So have libdm logic internal to recognize difference beween
pvmove and other targets that do use delayed resume.
This fixes problem introduced with commit aa68b898ff
for mirror-on-mirror or snapshot-on-mirror problem.
TODO: likely added new API call and let libdm user select
delayed nodes explicitely.
This commit is contained in:
parent
8c6fd0933f
commit
f70404addb
@ -303,7 +303,7 @@ static int _add_log(struct dm_pool *mem, struct lv_segment *seg,
|
||||
}
|
||||
} else {
|
||||
/* If core log, use mirror's UUID and set DM_CORELOG flag */
|
||||
if (!(log_dlid = build_dm_uuid(mem, seg->lv, NULL))) {
|
||||
if (!(log_dlid = build_dm_uuid(mem, seg->lv, lv_is_pvmove(seg->lv) ? "pvmove" : NULL))) {
|
||||
log_error("Failed to build uuid for mirror LV %s.",
|
||||
seg->lv->name);
|
||||
return 0;
|
||||
|
@ -2963,8 +2963,8 @@ int dm_tree_preload_children(struct dm_tree_node *dnode,
|
||||
/* Preload children first */
|
||||
while ((child = dm_tree_next_child(&handle, dnode, 0))) {
|
||||
/* Propagate delay of resume from parent node */
|
||||
if (dnode->props.delay_resume_if_new)
|
||||
child->props.delay_resume_if_new = 1;
|
||||
if (dnode->props.delay_resume_if_new > 1)
|
||||
child->props.delay_resume_if_new = dnode->props.delay_resume_if_new;
|
||||
|
||||
/* Skip existing non-device-mapper devices */
|
||||
if (!child->info.exists && child->info.major)
|
||||
@ -3342,7 +3342,8 @@ int dm_tree_node_add_mirror_target_log(struct dm_tree_node *node,
|
||||
}
|
||||
if ((flags & DM_CORELOG))
|
||||
/* For pvmove: immediate resume (for size validation) isn't needed. */
|
||||
node->props.delay_resume_if_new = 1;
|
||||
/* pvmove flag passed via unused UUID and its suffix */
|
||||
node->props.delay_resume_if_new = strstr(log_uuid, "pvmove") ? 2 : 1;
|
||||
else {
|
||||
if (!(log_node = dm_tree_find_node_by_uuid(node->dtree, log_uuid))) {
|
||||
log_error("Couldn't find mirror log uuid %s.", log_uuid);
|
||||
|
Loading…
Reference in New Issue
Block a user