summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr
diff options
context:
space:
mode:
authorRavishankar N <ravishankar@redhat.com>2015-09-03 09:49:56 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2015-09-07 19:16:37 -0700
commitc87cef1763aac974bcd335965ba44fab46e4326d (patch)
treec44a5aec8462c4bdd71fa2c2d82e1bcbb4add190 /xlators/cluster/afr
parent0600ffcc1fc425daa9c98d77a0f1531cd7902589 (diff)
afr: Do not wind the full writev payload to arbiter brick
...because the arbiter xlator just unwinds it without passing it down till posix anyway. Instead, send a one-byte vector so that afr write transaction works as expected. Backport of http://review.gluster.org/#/c/12095/ Change-Id: I52913ca51dfee0c8472cbadb62c5d39b7badef77 BUG: 1255110 Signed-off-by: Ravishankar N <ravishankar@redhat.com> Reviewed-on: http://review.gluster.org/12104 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'xlators/cluster/afr')
-rw-r--r--xlators/cluster/afr/src/afr-inode-write.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/xlators/cluster/afr/src/afr-inode-write.c b/xlators/cluster/afr/src/afr-inode-write.c
index 387d0d6cb7b..84876503e22 100644
--- a/xlators/cluster/afr/src/afr-inode-write.c
+++ b/xlators/cluster/afr/src/afr-inode-write.c
@@ -117,10 +117,17 @@ __afr_inode_write_fill (call_frame_t *frame, xlator_t *this, int child_index,
dict_t *xattr, dict_t *xdata)
{
afr_local_t *local = NULL;
+ afr_private_t *priv = NULL;
local = frame->local;
+ priv = this->private;
local->replies[child_index].valid = 1;
+
+ if (AFR_IS_ARBITER_BRICK(priv, child_index) && op_ret == 1)
+ op_ret = iov_length (local->cont.writev.vector,
+ local->cont.writev.count);
+
local->replies[child_index].op_ret = op_ret;
local->replies[child_index].op_errno = op_errno;
@@ -330,6 +337,24 @@ unlock:
return 0;
}
+static int
+afr_arbiter_writev_wind (call_frame_t *frame, xlator_t *this, int subvol)
+{
+ afr_local_t *local = frame->local;
+ afr_private_t *priv = this->private;
+ static char byte = 0xFF;
+ static struct iovec vector = {&byte, 1};
+ int32_t count = 1;
+
+ STACK_WIND_COOKIE (frame, afr_writev_wind_cbk, (void *) (long) subvol,
+ priv->children[subvol],
+ priv->children[subvol]->fops->writev,
+ local->fd, &vector, count, local->cont.writev.offset,
+ local->cont.writev.flags, local->cont.writev.iobref,
+ local->xdata_req);
+
+ return 0;
+}
int
afr_writev_wind (call_frame_t *frame, xlator_t *this, int subvol)
@@ -340,6 +365,11 @@ afr_writev_wind (call_frame_t *frame, xlator_t *this, int subvol)
local = frame->local;
priv = this->private;
+ if (AFR_IS_ARBITER_BRICK(priv, subvol)) {
+ afr_arbiter_writev_wind (frame, this, subvol);
+ return 0;
+ }
+
STACK_WIND_COOKIE (frame, afr_writev_wind_cbk, (void *) (long) subvol,
priv->children[subvol],
priv->children[subvol]->fops->writev,