diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c index acc6a67b4..3da41d343 100644 --- a/lib/activate/dev_manager.c +++ b/lib/activate/dev_manager.c @@ -976,7 +976,7 @@ static int _tree_action(struct dev_manager *dm, struct logical_volume *lv, actio goto_out; /* Preload any devices required before any suspensions */ - if (!dm_tree_preload_children(root, dlid, ID_LEN + sizeof(UUID_PREFIX) - 1)) + if (!dm_tree_preload_children(root, dlid, ID_LEN + sizeof(UUID_PREFIX) - 1, (lv->status & LOCKED) ? 0 : 1)) goto_out; if ((action == ACTIVATE) && diff --git a/libdm/libdm-deptree.c b/libdm/libdm-deptree.c index d8576424c..6886b4a50 100644 --- a/libdm/libdm-deptree.c +++ b/libdm/libdm-deptree.c @@ -1392,6 +1392,10 @@ int dm_tree_preload_children(struct dm_tree_node *dnode, } } + /* Don't load tables yet if this flag is set */ + if (!resume_children) + continue; + if (!child->info.inactive_table && child->props.segment_count) { if (!_load_node(child)) { stack; @@ -1400,7 +1404,7 @@ int dm_tree_preload_children(struct dm_tree_node *dnode, } /* Resume device immediately if it has parents */ - if (!resume_children || !dm_tree_node_num_children(child, 1)) + if (!dm_tree_node_num_children(child, 1)) continue; if (!_resume_node(name, child->info.major, child->info.minor, &newinfo)) {