diff --git a/WHATS_NEW b/WHATS_NEW index a7522f9ef..59820b293 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.105 - ===================================== + Try to remove any unusable devices from dm table when activation fails. Dependency scan counts with snapshots and external origins. Make sure VG extent size is always greater or equal to PV phys. block size. Optimize double call of stat() for cached devices. diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c index 7b0b6e291..a4147d35c 100644 --- a/lib/activate/dev_manager.c +++ b/lib/activate/dev_manager.c @@ -2754,15 +2754,21 @@ static int _tree_action(struct dev_manager *dm, struct logical_volume *lv, goto_out; /* Preload any devices required before any suspensions */ - if (!dm_tree_preload_children(root, dlid, DLID_SIZE)) + if (!dm_tree_preload_children(root, dlid, DLID_SIZE)) { + bad: + if (!dm_tree_deactivate_children(root, dlid, DLID_SIZE)) + stack; + if (!_remove_lv_symlinks(dm, root)) + log_warn("Failed to remove all device symlinks associated with %s.", lv->name); goto_out; + } if (dm_tree_node_size_changed(root)) dm->flush_required = 1; if (action == ACTIVATE) { if (!dm_tree_activate_children(root, dlid, DLID_SIZE)) - goto_out; + goto_bad; if (!_create_lv_symlinks(dm, root)) log_warn("Failed to create symlinks for %s.", lv->name); }