From 97f8454eccefe29464336ba1823448f4d1fa009b Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Sun, 2 Dec 2012 16:32:42 +0100 Subject: [PATCH] libdm: deactivate failed node in preload If the resume of preloaded node fails, do not leave such node in the table - since it may not be easy to detach such node later when the node is i.e. internal. i.e. failing activation of the thin pool with mismatching chunk size may leave -tpool device in the table, which could have been then removed only by dmsetup command. --- WHATS_NEW_DM | 1 + libdm/libdm-deptree.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM index 3ea0502bc..75bd1b308 100644 --- a/WHATS_NEW_DM +++ b/WHATS_NEW_DM @@ -1,5 +1,6 @@ Version 1.02.78 - =================================== + Automatically deactivate failed preloaded dm tree node. Add DM_DISABLE_UDEV environment variable to manage dev nodes by libdm only. Fix dm_task_set_cookie to properly process udev flags if udev_sync disabled. diff --git a/libdm/libdm-deptree.c b/libdm/libdm-deptree.c index 096eba2f0..e4a574d05 100644 --- a/libdm/libdm-deptree.c +++ b/libdm/libdm-deptree.c @@ -2496,6 +2496,11 @@ int dm_tree_preload_children(struct dm_tree_node *dnode, log_error("Unable to resume %s (%" PRIu32 ":%" PRIu32 ")", child->name, child->info.major, child->info.minor); + if (!_deactivate_node(child->name, child->info.major, child->info.minor, + &child->dtree->cookie, child->udev_flags, 0)) + log_error("Unable to deactivate %s (%" PRIu32 + ":%" PRIu32 ")", child->name, child->info.major, + child->info.minor); r = 0; continue; }