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

Thin send messages on activation resume code path

Using PRELOAD part would lead to problems when the problem
would happen before vg_write and vg_commit.
Also this change is necessary for snapshot creation sequence.
This commit is contained in:
Zdenek Kabelac 2012-01-25 08:46:21 +00:00
parent 3f61871f38
commit 4173a22832

View File

@ -1768,6 +1768,17 @@ int dm_tree_activate_children(struct dm_tree_node *dnode,
}
}
/*
* FIXME: Implement delayed error reporting
* activation should be stopped only in the case,
* the submission of transation_id message fails,
* resume should continue further, just whole command
* has to report failure.
*/
if (r && dnode->props.send_messages &&
!(r = _node_send_messages(dnode, uuid_prefix, uuid_prefix_len)))
stack;
handle = NULL;
return r;
@ -2434,11 +2445,6 @@ int dm_tree_preload_children(struct dm_tree_node *dnode,
/* Update cached info */
child->info = newinfo;
if (child->props.send_messages &&
!(r = _node_send_messages(child, uuid_prefix, uuid_prefix_len))) {
stack;
continue;
}
/*
* Prepare for immediate synchronization with udev and flush all stacked
* dev node operations if requested by immediate_dev_node property. But
@ -2448,23 +2454,12 @@ int dm_tree_preload_children(struct dm_tree_node *dnode,
update_devs_flag = 1;
}
if (r && dnode->props.send_messages &&
!(r = _node_send_messages(dnode, uuid_prefix, uuid_prefix_len)))
stack;
if (update_devs_flag) {
if (!dm_udev_wait(dm_tree_get_cookie(dnode)))
stack;
dm_tree_set_cookie(dnode, 0);
}
if (r && !_node_send_messages(dnode, uuid_prefix, uuid_prefix_len)) {
stack;
if (!(dm_tree_deactivate_children(dnode, uuid_prefix, uuid_prefix_len)))
log_error("Failed to deactivate %s", dnode->name);
r = 0;
}
return r;
}