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.
* 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;
}