887953
From cdedd41ab825bfe59e8d1739fdea625a51f659f9 Mon Sep 17 00:00:00 2001
887953
From: Soumya Koduri <skoduri@redhat.com>
887953
Date: Fri, 9 Nov 2018 02:29:52 -0500
887953
Subject: [PATCH 474/493] afr: open_ftruncate_cbk should read fd from
887953
 local->cont.open struct
887953
887953
afr_open stores the fd as part of its local->cont.open struct
887953
but when it calls ftruncate (if open flags contain O_TRUNC), the
887953
corresponding cbk function (afr_ open_ftruncate_cbk) is
887953
incorrectly referencing uninitialized local->fd. This patch fixes
887953
the same.
887953
887953
Upstream reference:
887953
Change-Id: Icbdedbd1b8cfea11d8f41b6e5c4cb4b44d989aba
887953
> updates: bz#1648687
887953
> review-url: https://review.gluster.org/#/c/glusterfs/+/21617/
887953
887953
BUG: 1655578
887953
updates: bz#1655578
887953
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
887953
Change-Id: I9c26eadd811fdd32630227f3130dec28e4b6972b
887953
Reviewed-on: https://code.engineering.redhat.com/gerrit/158799
887953
Tested-by: RHGS Build Bot <nigelb@redhat.com>
887953
Reviewed-by: Karthik Subrahmanya <ksubrahm@redhat.com>
887953
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
887953
---
887953
 xlators/cluster/afr/src/afr-open.c | 2 +-
887953
 1 file changed, 1 insertion(+), 1 deletion(-)
887953
887953
diff --git a/xlators/cluster/afr/src/afr-open.c b/xlators/cluster/afr/src/afr-open.c
887953
index 6c625cc..d820462 100644
887953
--- a/xlators/cluster/afr/src/afr-open.c
887953
+++ b/xlators/cluster/afr/src/afr-open.c
887953
@@ -62,7 +62,7 @@ afr_open_ftruncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
887953
         afr_local_t * local = frame->local;
887953
 
887953
         AFR_STACK_UNWIND (open, frame, local->op_ret, local->op_errno,
887953
-                          local->fd, xdata);
887953
+                          local->cont.open.fd, xdata);
887953
         return 0;
887953
 }
887953
 
887953
-- 
887953
1.8.3.1
887953