Re: [PATCH 2/5] libdm-deptree-return-failure-suspend-children
Mike Snitzer <[email protected]> Fri, 20 Nov 2009 21:26:31 -0500
| Newsgroups | dev.linux.lists.lvm-devel |
|---|---|
| Message-ID | <[email protected]> |
On Fri, Nov 20 2009 at 5:57pm -0500, Zdenek Kabelac <[email protected]> wrote: > Dne 20.11.2009 22:29, Mike Snitzer napsal(a): > > Return error immediately to dm_tree_suspend_children() callers. > > > > Otherwise suspend_lv and its variants can fail silently. > > > > Signed-off-by: Mike Snitzer <[email protected]> > > --- > > libdm/libdm-deptree.c | 5 +++-- > > 1 files changed, 3 insertions(+), 2 deletions(-) > > > > diff --git a/libdm/libdm-deptree.c b/libdm/libdm-deptree.c > > index bb10fe5..6f5355d 100644 > > --- a/libdm/libdm-deptree.c > > +++ b/libdm/libdm-deptree.c > > @@ -1109,7 +1109,7 @@ int dm_tree_suspend_children(struct dm_tree_node *dnode, > > log_error("Unable to suspend %s (%" PRIu32 > > ":%" PRIu32 ")", name, info.major, > > info.minor); > > - continue; > > + return 0; > > } > > > This is a bit hard to tell what's the right way here - either to continue > suspending 'the rest of the monster' or to stop with the first failure. > > In case of the replicator - when suspend of one head would fail - I would > probably prefer to see the code to continue suspending remaing heads. OK, the other possibility that Alasdair and I discussed is that we could return failure once all nodes at the same level have been processed. Would that work for replicator? Are all heads at the same level in the tree? Mike