summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/cluster/afr/src/afr-dir-read.c15
-rw-r--r--xlators/cluster/afr/src/afr-lk-common.c43
2 files changed, 37 insertions, 21 deletions
diff --git a/xlators/cluster/afr/src/afr-dir-read.c b/xlators/cluster/afr/src/afr-dir-read.c
index a6b13f7c991..1f29cc006f1 100644
--- a/xlators/cluster/afr/src/afr-dir-read.c
+++ b/xlators/cluster/afr/src/afr-dir-read.c
@@ -226,14 +226,20 @@ afr_opendir_cbk (call_frame_t *frame, void *cookie,
xlator_t *this, int32_t op_ret, int32_t op_errno,
fd_t *fd)
{
- afr_local_t * local = NULL;
+ afr_private_t *priv = NULL;
+ afr_local_t *local = NULL;
+ int32_t up_children_count = 0;
int call_count = -1;
+ priv = this->private;
+ local = frame->local;
+
+ up_children_count = afr_up_children_count (priv->child_count,
+ local->child_up);
+
LOCK (&frame->lock);
{
- local = frame->local;
-
if (op_ret >= 0)
local->op_ret = op_ret;
@@ -247,7 +253,8 @@ afr_opendir_cbk (call_frame_t *frame, void *cookie,
if (local->op_ret == 0) {
afr_fd_ctx_set (this, local->fd);
- if (!afr_is_opendir_done (this, local->fd->inode)) {
+ if (!afr_is_opendir_done (this, local->fd->inode) &&
+ up_children_count > 1) {
/*
* This is the first opendir on this inode. We need
diff --git a/xlators/cluster/afr/src/afr-lk-common.c b/xlators/cluster/afr/src/afr-lk-common.c
index 50f253e8cdf..749c6bf9a59 100644
--- a/xlators/cluster/afr/src/afr-lk-common.c
+++ b/xlators/cluster/afr/src/afr-lk-common.c
@@ -615,6 +615,10 @@ afr_unlock_inodelk (call_frame_t *frame, xlator_t *this)
priv->children[i]->fops->finodelk,
this->name, local->fd,
F_SETLK, &flock);
+
+ if (!--call_count)
+ break;
+
} else {
afr_trace_inodelk_in (frame, AFR_INODELK_TRANSACTION,
AFR_UNLOCK_OP, &flock, F_SETLK, i);
@@ -625,12 +629,14 @@ afr_unlock_inodelk (call_frame_t *frame, xlator_t *this)
priv->children[i]->fops->inodelk,
this->name, &local->loc,
F_SETLK, &flock);
+
+ if (!--call_count)
+ break;
+
}
}
- if (!--call_count)
- break;
}
out:
@@ -693,10 +699,10 @@ afr_unlock_entrylk (call_frame_t *frame, xlator_t *this)
this->name,
loc, basename,
ENTRYLK_UNLOCK, ENTRYLK_WRLCK);
- }
- if (!--call_count)
- break;
+ if (!--call_count)
+ break;
+ }
}
out:
@@ -1267,10 +1273,11 @@ afr_nonblocking_entrylk (call_frame_t *frame, xlator_t *this)
priv->children[i]->fops->entrylk,
this->name, loc, basename,
ENTRYLK_LOCK, ENTRYLK_WRLCK);
- }
- if (!--call_count)
- break;
+ if (!--call_count)
+ break;
+
+ }
}
}
@@ -1405,10 +1412,10 @@ afr_nonblocking_inodelk (call_frame_t *frame, xlator_t *this)
this->name, local->fd,
F_SETLK, &flock);
- }
+ if (!--call_count)
+ break;
- if (!--call_count)
- break;
+ }
}
} else {
@@ -1426,10 +1433,11 @@ afr_nonblocking_inodelk (call_frame_t *frame, xlator_t *this)
priv->children[i]->fops->inodelk,
this->name, &local->loc,
F_SETLK, &flock);
- }
- if (!--call_count)
- break;
+ if (!--call_count)
+ break;
+
+ }
}
}
@@ -1525,10 +1533,11 @@ afr_unlock_lower_entrylk (call_frame_t *frame, xlator_t *this)
this->name,
loc, basename,
ENTRYLK_UNLOCK, ENTRYLK_WRLCK);
- }
- if (!--call_count)
- break;
+ if (!--call_count)
+ break;
+
+ }
}
out: