summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-dir-read.c
diff options
context:
space:
mode:
authorPavan Sondur <pavan@gluster.com>2010-09-06 09:01:24 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-09-06 09:38:18 -0700
commitd38b2217393c460937505f30bd61576e7957f877 (patch)
treef3d69e93d6c8337146c7ba0fabc40ec44204c2a7 /xlators/cluster/afr/src/afr-dir-read.c
parent716776f2e35d240db7b9731a4eda557a0be462f8 (diff)
cluster/afr: Fix hang in create when one subvol is down.
Signed-off-by: Pavan Vilas Sondur <pavan@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1544 (Create fails when 1 server is down) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1544
Diffstat (limited to 'xlators/cluster/afr/src/afr-dir-read.c')
-rw-r--r--xlators/cluster/afr/src/afr-dir-read.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/xlators/cluster/afr/src/afr-dir-read.c b/xlators/cluster/afr/src/afr-dir-read.c
index a6b13f7c9..1f29cc006 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