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

Return error to dm_tree_suspend_children() callers.

Otherwise suspend_lv and its variants can fail silently.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
This commit is contained in:
Mike Snitzer 2010-01-05 21:05:40 +00:00
parent 2ca6b865f6
commit 68085c93b0

View File

@ -1067,6 +1067,7 @@ int dm_tree_suspend_children(struct dm_tree_node *dnode,
const char *uuid_prefix, const char *uuid_prefix,
size_t uuid_prefix_len) size_t uuid_prefix_len)
{ {
int r = 1;
void *handle = NULL; void *handle = NULL;
struct dm_tree_node *child = dnode; struct dm_tree_node *child = dnode;
struct dm_info info, newinfo; struct dm_info info, newinfo;
@ -1109,6 +1110,7 @@ int dm_tree_suspend_children(struct dm_tree_node *dnode,
log_error("Unable to suspend %s (%" PRIu32 log_error("Unable to suspend %s (%" PRIu32
":%" PRIu32 ")", name, info.major, ":%" PRIu32 ")", name, info.major,
info.minor); info.minor);
r = 0;
continue; continue;
} }
@ -1130,10 +1132,11 @@ int dm_tree_suspend_children(struct dm_tree_node *dnode,
continue; continue;
if (dm_tree_node_num_children(child, 0)) if (dm_tree_node_num_children(child, 0))
dm_tree_suspend_children(child, uuid_prefix, uuid_prefix_len); if (!dm_tree_suspend_children(child, uuid_prefix, uuid_prefix_len))
return_0;
} }
return 1; return r;
} }
int dm_tree_activate_children(struct dm_tree_node *dnode, int dm_tree_activate_children(struct dm_tree_node *dnode,