summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/cluster/afr/src/afr-common.c13
-rw-r--r--xlators/cluster/afr/src/afr-lk-common.c18
2 files changed, 30 insertions, 1 deletions
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c
index 5277e3e3eaa..38e58ba9559 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,
diff --git a/xlators/cluster/afr/src/afr-lk-common.c b/xlators/cluster/afr/src/afr-lk-common.c
index dc850d38fc0..a7cd60f30dd 100644
--- a/xlators/cluster/afr/src/afr-lk-common.c
+++ b/xlators/cluster/afr/src/afr-lk-common.c
@@ -628,6 +628,9 @@ afr_unlock_inodelk (call_frame_t *frame, xlator_t *this)
}
}
+
+ if (!--call_count)
+ break;
}
out:
@@ -691,6 +694,9 @@ afr_unlock_entrylk (call_frame_t *frame, xlator_t *this)
loc, basename,
ENTRYLK_UNLOCK, ENTRYLK_WRLCK);
}
+
+ if (!--call_count)
+ break;
}
out:
@@ -1262,6 +1268,9 @@ afr_nonblocking_entrylk (call_frame_t *frame, xlator_t *this)
this->name, loc, basename,
ENTRYLK_LOCK, ENTRYLK_WRLCK);
}
+
+ if (!--call_count)
+ break;
}
}
@@ -1397,6 +1406,10 @@ afr_nonblocking_inodelk (call_frame_t *frame, xlator_t *this)
F_SETLK, &flock);
}
+
+ if (!--call_count)
+ break;
+
}
} else {
call_count = internal_lock_count (frame, this, NULL);
@@ -1414,6 +1427,9 @@ afr_nonblocking_inodelk (call_frame_t *frame, xlator_t *this)
this->name, &local->loc,
F_SETLK, &flock);
}
+
+ if (!--call_count)
+ break;
}
}
@@ -1511,6 +1527,8 @@ afr_unlock_lower_entrylk (call_frame_t *frame, xlator_t *this)
ENTRYLK_UNLOCK, ENTRYLK_WRLCK);
}
+ if (!--call_count)
+ break;
}
out: