diff options
author | Pavan Sondur <pavan@gluster.com> | 2010-08-31 10:25:51 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@dev.gluster.com> | 2010-08-31 11:55:46 -0700 |
commit | 25dc93419e882ba733841a18e8addc1c7a6a01ab (patch) | |
tree | e9e8243f7fa2ac6282538c1e7f4d86c061a2da4f /xlators/cluster/afr/src/afr-common.c | |
parent | 70652df2f7780aa734119941ac54d88ae6de7ae9 (diff) |
cluster/afr: Break STACK_WIND loop when the call count is reached.
Fix also has a check for self heal relevant to pump.
Tested with dbench with AFR client and pump on server.
Signed-off-by: Pavan Vilas Sondur <pavan@gluster.com>
Signed-off-by: Vijay Bellur <vijay@dev.gluster.com>
BUG: 1443 (Crash in afr_nonblocking_entrylk_cbk)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1443
Diffstat (limited to 'xlators/cluster/afr/src/afr-common.c')
-rw-r--r-- | xlators/cluster/afr/src/afr-common.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c index 5277e3e3e..38e58ba95 100644 --- a/xlators/cluster/afr/src/afr-common.c +++ b/xlators/cluster/afr/src/afr-common.c @@ -597,10 +597,13 @@ afr_lookup_done (call_frame_t *frame, xlator_t *this, struct iatt *lookup_buf) { int unwind = 1; int source = -1; + int up_count = 0; char sh_type_str[256] = {0,}; - afr_local_t *local = NULL; + afr_private_t *priv = NULL; + afr_local_t *local = NULL; + priv = this->private; local = frame->local; local->cont.lookup.postparent.ia_ino = local->cont.lookup.parent_ino; @@ -610,6 +613,13 @@ afr_lookup_done (call_frame_t *frame, xlator_t *this, struct iatt *lookup_buf) local->cont.lookup.buf.ia_gen = local->cont.lookup.gen; } + up_count = afr_up_children_count (priv->child_count, priv->child_up); + if (up_count == 1) { + gf_log (this->name, GF_LOG_DEBUG, + "Only 1 child up - do not attempt to detect self heal"); + goto unwind; + } + if (local->op_ret == 0) { /* KLUDGE: assuming DHT will not itransform in revalidate */ @@ -689,6 +699,7 @@ afr_lookup_done (call_frame_t *frame, xlator_t *this, struct iatt *lookup_buf) } } +unwind: if (unwind) { AFR_STACK_UNWIND (lookup, frame, local->op_ret, local->op_errno, |