mirror of
git://sourceware.org/git/lvm2.git
synced 2025-04-01 18:50:41 +03:00
libdm: enhance thin-pool preload
When preloading thin-pool device node for already existing/running thin-pool do not resume such thin-pool. This allows to properly schedule commit point for metadata, when thin-pool data or metadata volume is resized.
This commit is contained in:
parent
ddbf0075b1
commit
6ca5447e0c
@ -1,5 +1,6 @@
|
||||
Version 1.02.112 -
|
||||
=====================================
|
||||
Improve preloading sequence of an active thin-pool target.
|
||||
Drop extra space from cache target line to fix unneded table reloads.
|
||||
|
||||
Version 1.02.111 - 23rd November 2015
|
||||
|
@ -2788,6 +2788,7 @@ int dm_tree_preload_children(struct dm_tree_node *dnode,
|
||||
struct dm_tree_node *child;
|
||||
struct dm_info newinfo;
|
||||
int update_devs_flag = 0;
|
||||
struct load_segment *seg;
|
||||
|
||||
/* Preload children first */
|
||||
while ((child = dm_tree_next_child(&handle, dnode, 0))) {
|
||||
@ -2835,6 +2836,22 @@ int dm_tree_preload_children(struct dm_tree_node *dnode,
|
||||
if (!dm_tree_node_num_children(child, 1) || !child->props.size_changed)
|
||||
continue;
|
||||
|
||||
if (!node_created && (dm_list_size(&child->props.segs) == 1)) {
|
||||
/* If thin-pool child nodes were preloaded WITH changed size
|
||||
* skip device resume, as this is likely resize of data or
|
||||
* metadata device and so thin pool needs suspend before
|
||||
* resume operation.
|
||||
* Note: child->props.segment_count is already 0 here
|
||||
*/
|
||||
seg = dm_list_item(dm_list_last(&child->props.segs),
|
||||
struct load_segment);
|
||||
if (seg->type == SEG_THIN_POOL) {
|
||||
log_debug_activation("Skipping resume of thin-pool %s.",
|
||||
child->name);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (!child->info.inactive_table && !child->info.suspended)
|
||||
continue;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user