Blob Blame History Raw
From 89b754add37ec07101e1ec3a9d5c7da09de16456 Mon Sep 17 00:00:00 2001
From: Ravishankar N <ravishankar@redhat.com>
Date: Mon, 5 Dec 2016 21:49:52 +0530
Subject: [PATCH 228/235] afr: fix bug in passing child index in
 afr_inode_write_fill

Backport of  http://review.gluster.org/#/c/16029/
Signed-off-by: Ravishankar N <ravishankar@redhat.com>

Change-Id: I3ad5cf55cfc24ce3e5b3fac91190d8841000ca56
BUG: 1401380
Reviewed-on: https://code.engineering.redhat.com/gerrit/92132
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
---
 xlators/cluster/afr/src/afr-transaction.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/xlators/cluster/afr/src/afr-transaction.c b/xlators/cluster/afr/src/afr-transaction.c
index 4a551d1..479f71f 100644
--- a/xlators/cluster/afr/src/afr-transaction.c
+++ b/xlators/cluster/afr/src/afr-transaction.c
@@ -1231,7 +1231,6 @@ afr_pre_op_writev_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
         compound_args_cbk_t *args_cbk = data;
         int call_count = -1;
         int child_index = -1;
-        int i = 0;
 
         local = frame->local;
         priv = this->private;
@@ -1250,11 +1249,11 @@ afr_pre_op_writev_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
          * Handle that case by passing the op_ret, op_errno values explicitly.
          */
         if ((op_ret == -1) && (args_cbk == NULL)) {
-                afr_inode_write_fill  (frame, this, (long) i, op_ret, op_errno,
-                                       NULL, NULL, NULL);
+                afr_inode_write_fill  (frame, this, child_index, op_ret,
+                                       op_errno, NULL, NULL, NULL);
         } else {
                 write_args_cbk = &args_cbk->rsp_list[1];
-                afr_inode_write_fill  (frame, this, (long) child_index,
+                afr_inode_write_fill  (frame, this, child_index,
                                        write_args_cbk->op_ret,
                                        write_args_cbk->op_errno,
                                        &write_args_cbk->prestat,
-- 
2.9.3