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

device_mapper: deactive new nodes when load fails

When node loading fails, there is not much the caller can do,
since there is 'unknown' set of devices preloaded.

Only suspend during preload knows future precommitted 'metadata',
so it's non-trivial to drop 'preloaded' entries with any later call.

However dm tree tracks newly loaded entries - so in this case it
may simplify the recovery path by dropping preloaded entries so
they are not leaked in the DM table.
This commit is contained in:
Zdenek Kabelac 2018-06-29 17:25:38 +02:00
parent f2b856c994
commit d56e400d44

View File

@ -2877,8 +2877,14 @@ int dm_tree_preload_children(struct dm_tree_node *dnode,
* insufficient to remove those - only the node
* encountering the table load failure is removed.
*/
if (node_created && !_remove_node(child))
return_0;
if (node_created) {
if (!_remove_node(child))
return_0;
if (!dm_udev_wait(dm_tree_get_cookie(dnode)))
stack;
dm_tree_set_cookie(dnode, 0);
(void) _dm_tree_revert_activated(child);
}
return_0;
}