From da74288339563759f568aa5052fdce4c45ebcd22 Mon Sep 17 00:00:00 2001 From: Vijay Bellur Date: Thu, 30 Sep 2010 11:41:07 +0000 Subject: glusterfsd: perform init new graph if re-configure fails Signed-off-by: Vijay Bellur Signed-off-by: Vijay Bellur BUG: 1235 (Bug for all pump/migrate commits) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1235 --- libglusterfs/src/xlator.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'libglusterfs') diff --git a/libglusterfs/src/xlator.c b/libglusterfs/src/xlator.c index a09dd2e1eb0..105ee497b17 100644 --- a/libglusterfs/src/xlator.c +++ b/libglusterfs/src/xlator.c @@ -921,6 +921,7 @@ xlator_reconfigure_rec (xlator_t *old_xl, xlator_t *new_xl) { xlator_list_t *trav1 = NULL; xlator_list_t *trav2 = NULL; + int32_t ret = 0; if (old_xl == NULL || new_xl == NULL) { gf_log ("xlator", GF_LOG_DEBUG, "invalid argument"); @@ -931,7 +932,10 @@ xlator_reconfigure_rec (xlator_t *old_xl, xlator_t *new_xl) trav2 = new_xl->children; while (trav1 && trav2) { - xlator_reconfigure_rec (trav1->xlator, trav2->xlator); + ret = xlator_reconfigure_rec (trav1->xlator, trav2->xlator); + + if (ret) + goto out; gf_log (trav1->xlator->name, GF_LOG_DEBUG, "reconfigured"); @@ -939,12 +943,16 @@ xlator_reconfigure_rec (xlator_t *old_xl, xlator_t *new_xl) trav2 = trav2->next; } - if (old_xl->reconfigure) - old_xl->reconfigure (old_xl, new_xl->options); + if (old_xl->reconfigure) { + ret = old_xl->reconfigure (old_xl, new_xl->options); + if (ret) + goto out; + } else gf_log (old_xl->name, GF_LOG_DEBUG, "No reconfigure() found"); - return 0; +out: + return ret; } int -- cgit