From 5cec042dfa7d7c9699d3110f849a78b2569aa8d9 Mon Sep 17 00:00:00 2001 From: Anand Avati Date: Mon, 12 Oct 2009 11:26:59 +0000 Subject: replicate: fix missing frame in entry-self-heal when files on all backend nodes are missing, the logic in afr_sh_entry_erase_pending is broken and results in missing lookup frame. this causes processes to enter into uninterruptible sleep state. Signed-off-by: Anand V. Avati BUG: 311 (missing frame (lookup) when entry-selfheal finds missing files in all backend nodes) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=311 --- xlators/cluster/afr/src/afr-self-heal-entry.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'xlators/cluster/afr/src/afr-self-heal-entry.c') diff --git a/xlators/cluster/afr/src/afr-self-heal-entry.c b/xlators/cluster/afr/src/afr-self-heal-entry.c index 305cafdbe49..b44418dd68e 100644 --- a/xlators/cluster/afr/src/afr-self-heal-entry.c +++ b/xlators/cluster/afr/src/afr-self-heal-entry.c @@ -211,6 +211,7 @@ afr_sh_entry_erase_pending (call_frame_t *frame, xlator_t *this) int call_count = 0; int i = 0; dict_t **erase_xattr = NULL; + int need_unwind = 0; local = frame->local; @@ -231,6 +232,9 @@ afr_sh_entry_erase_pending (call_frame_t *frame, xlator_t *this) } } + if (call_count == 0) + need_unwind = 1; + afr_sh_delta_to_xattr (priv, sh->delta_matrix, erase_xattr, priv->child_count, AFR_ENTRY_TRANSACTION); @@ -260,6 +264,9 @@ afr_sh_entry_erase_pending (call_frame_t *frame, xlator_t *this) } FREE (erase_xattr); + if (need_unwind) + afr_sh_entry_finish (frame, this); + return 0; } -- cgit