From dc648b30d2b892ef9413a32893070d1abf69f3df Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Sat, 18 Sep 2010 03:20:58 +0000 Subject: cluster/replicate: stack_wind into read_child only if it is up. Signed-off-by: Raghavendra G Signed-off-by: Vijay Bellur BUG: 1637 (replicate should wind reads into read-child only if it is up) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1637 --- xlators/cluster/afr/src/afr-inode-read.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/xlators/cluster/afr/src/afr-inode-read.c b/xlators/cluster/afr/src/afr-inode-read.c index 74f3d9ddb0e..8d6e12a93dd 100644 --- a/xlators/cluster/afr/src/afr-inode-read.c +++ b/xlators/cluster/afr/src/afr-inode-read.c @@ -138,7 +138,7 @@ afr_access (call_frame_t *frame, xlator_t *this, read_child = afr_read_child (this, loc->inode); - if (read_child >= 0) { + if ((read_child >= 0) && (priv->child_up[read_child])) { call_child = read_child; local->cont.access.last_tried = -1; @@ -260,7 +260,7 @@ afr_stat (call_frame_t *frame, xlator_t *this, read_child = afr_read_child (this, loc->inode); - if (read_child >= 0) { + if ((read_child >= 0) && (priv->child_up[read_child])) { call_child = read_child; local->cont.stat.last_tried = -1; @@ -387,7 +387,7 @@ afr_fstat (call_frame_t *frame, xlator_t *this, read_child = afr_read_child (this, fd->inode); - if (read_child >= 0) { + if ((read_child >= 0) && (priv->child_up[read_child])) { call_child = read_child; local->cont.fstat.last_tried = -1; @@ -509,7 +509,7 @@ afr_readlink (call_frame_t *frame, xlator_t *this, read_child = afr_read_child (this, loc->inode); - if (read_child >= 0) { + if ((read_child >= 0) && (priv->child_up[read_child])) { call_child = read_child; local->cont.readlink.last_tried = -1; @@ -695,7 +695,7 @@ afr_getxattr (call_frame_t *frame, xlator_t *this, read_child = afr_read_child (this, loc->inode); - if (read_child >= 0) { + if ((read_child >= 0) && (priv->child_up[read_child])) { call_child = read_child; local->cont.getxattr.last_tried = -1; @@ -842,7 +842,7 @@ afr_readv (call_frame_t *frame, xlator_t *this, read_child = afr_read_child (this, fd->inode); - if (read_child >= 0) { + if ((read_child >= 0) && (priv->child_up[read_child])) { call_child = read_child; /* -- cgit