3604df
From 89b754add37ec07101e1ec3a9d5c7da09de16456 Mon Sep 17 00:00:00 2001
3604df
From: Ravishankar N <ravishankar@redhat.com>
3604df
Date: Mon, 5 Dec 2016 21:49:52 +0530
3604df
Subject: [PATCH 228/235] afr: fix bug in passing child index in
3604df
 afr_inode_write_fill
3604df
3604df
Backport of  http://review.gluster.org/#/c/16029/
3604df
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
3604df
3604df
Change-Id: I3ad5cf55cfc24ce3e5b3fac91190d8841000ca56
3604df
BUG: 1401380
3604df
Reviewed-on: https://code.engineering.redhat.com/gerrit/92132
3604df
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
3604df
Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
3604df
---
3604df
 xlators/cluster/afr/src/afr-transaction.c | 7 +++----
3604df
 1 file changed, 3 insertions(+), 4 deletions(-)
3604df
3604df
diff --git a/xlators/cluster/afr/src/afr-transaction.c b/xlators/cluster/afr/src/afr-transaction.c
3604df
index 4a551d1..479f71f 100644
3604df
--- a/xlators/cluster/afr/src/afr-transaction.c
3604df
+++ b/xlators/cluster/afr/src/afr-transaction.c
3604df
@@ -1231,7 +1231,6 @@ afr_pre_op_writev_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
3604df
         compound_args_cbk_t *args_cbk = data;
3604df
         int call_count = -1;
3604df
         int child_index = -1;
3604df
-        int i = 0;
3604df
 
3604df
         local = frame->local;
3604df
         priv = this->private;
3604df
@@ -1250,11 +1249,11 @@ afr_pre_op_writev_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
3604df
          * Handle that case by passing the op_ret, op_errno values explicitly.
3604df
          */
3604df
         if ((op_ret == -1) && (args_cbk == NULL)) {
3604df
-                afr_inode_write_fill  (frame, this, (long) i, op_ret, op_errno,
3604df
-                                       NULL, NULL, NULL);
3604df
+                afr_inode_write_fill  (frame, this, child_index, op_ret,
3604df
+                                       op_errno, NULL, NULL, NULL);
3604df
         } else {
3604df
                 write_args_cbk = &args_cbk->rsp_list[1];
3604df
-                afr_inode_write_fill  (frame, this, (long) child_index,
3604df
+                afr_inode_write_fill  (frame, this, child_index,
3604df
                                        write_args_cbk->op_ret,
3604df
                                        write_args_cbk->op_errno,
3604df
                                        &write_args_cbk->prestat,
3604df
-- 
3604df
2.9.3
3604df