All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] libdm-deptree-return-failure-activate-and-preload-children
@ 2009-11-20 21:29 Mike Snitzer
  2009-11-20 21:29 ` [PATCH 2/5] libdm-deptree-return-failure-suspend-children Mike Snitzer
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Mike Snitzer @ 2009-11-20 21:29 UTC (permalink / raw)
  To: lvm-devel

Return error immediately to dm_tree_preload_children() and
dm_tree_activate_children() callers.

Otherwise resume_lv and its variants can fail silently.

Catching these failures is especially important now that dm targets like
crypt and snapshot-merge can fail in .preresume

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
---
 libdm/libdm-deptree.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/libdm/libdm-deptree.c b/libdm/libdm-deptree.c
index 1465fd3..bb10fe5 100644
--- a/libdm/libdm-deptree.c
+++ b/libdm/libdm-deptree.c
@@ -1158,7 +1158,8 @@ int dm_tree_activate_children(struct dm_tree_node *dnode,
 			continue;
 
 		if (dm_tree_node_num_children(child, 0))
-			dm_tree_activate_children(child, uuid_prefix, uuid_prefix_len);
+			if (!dm_tree_activate_children(child, uuid_prefix, uuid_prefix_len))
+				return_0;
 	}
 
 	handle = NULL;
@@ -1204,7 +1205,7 @@ int dm_tree_activate_children(struct dm_tree_node *dnode,
 				log_error("Unable to resume %s (%" PRIu32
 					  ":%" PRIu32 ")", child->name, child->info.major,
 					  child->info.minor);
-				continue;
+				return 0;
 			}
 
 			/* Update cached info */
@@ -1621,7 +1622,8 @@ int dm_tree_preload_children(struct dm_tree_node *dnode,
 			continue;
 
 		if (dm_tree_node_num_children(child, 0))
-			dm_tree_preload_children(child, uuid_prefix, uuid_prefix_len);
+			if (!dm_tree_preload_children(child, uuid_prefix, uuid_prefix_len))
+				return_0;
 
 		/* FIXME Cope if name exists with no uuid? */
 		if (!child->info.exists) {
@@ -1655,7 +1657,7 @@ 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);
-			continue;
+			return 0;
 		}
 
 		/* Update cached info */
-- 
1.6.5.2



^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-11-22 20:31 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-20 21:29 [PATCH 1/5] libdm-deptree-return-failure-activate-and-preload-children Mike Snitzer
2009-11-20 21:29 ` [PATCH 2/5] libdm-deptree-return-failure-suspend-children Mike Snitzer
2009-11-20 22:57   ` Zdenek Kabelac
2009-11-21  2:26     ` Mike Snitzer
2009-11-22 20:31       ` Zdenek Kabelac
2009-11-20 21:29 ` [PATCH 3/5] libdm-deptree-return-failure-deactivate-children Mike Snitzer
2009-11-20 21:29 ` [PATCH 4/5] lvm-stack-on-resume-and-suspend-failures Mike Snitzer
2009-11-20 23:11   ` Zdenek Kabelac
2009-11-20 21:29 ` [PATCH 5/5] lvm-stack-on-activate-and-deactivate-failures Mike Snitzer
2009-11-20 22:51 ` [PATCH 1/5] libdm-deptree-return-failure-activate-and-preload-children Zdenek Kabelac

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.