summaryrefslogtreecommitdiffstats
path: root/xlators/cluster
diff options
context:
space:
mode:
authorSoumya Koduri <skoduri@redhat.com>2018-11-09 02:29:52 -0500
committerRavishankar N <ravishankar@redhat.com>2018-11-15 05:07:23 +0000
commitfda594875c4cdb2a22e27aa13f5c66bee032ccb5 (patch)
treeae5e02de126d1747f38ca238cff9aecf3cf37d33 /xlators/cluster
parent4a4ba1f2eb0be2da9e88560246730af87788295f (diff)
afr: open_ftruncate_cbk should read fd from local->cont.open struct
afr_open stores the fd as part of its local->cont.open struct but when it calls ftruncate (if open flags contain O_TRUNC), the corresponding cbk function (afr_ open_ftruncate_cbk) is incorrectly referencing uninitialized local->fd. This patch fixes the same. Change-Id: Icbdedbd1b8cfea11d8f41b6e5c4cb4b44d989aba updates: bz#1648687 Signed-off-by: Soumya Koduri <skoduri@redhat.com>
Diffstat (limited to 'xlators/cluster')
-rw-r--r--xlators/cluster/afr/src/afr-open.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xlators/cluster/afr/src/afr-open.c b/xlators/cluster/afr/src/afr-open.c
index a202d528ec8..1763dc0a4cc 100644
--- a/xlators/cluster/afr/src/afr-open.c
+++ b/xlators/cluster/afr/src/afr-open.c
@@ -56,8 +56,8 @@ afr_open_ftruncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
{
afr_local_t *local = frame->local;
- AFR_STACK_UNWIND(open, frame, local->op_ret, local->op_errno, local->fd,
- xdata);
+ AFR_STACK_UNWIND(open, frame, local->op_ret, local->op_errno,
+ local->cont.open.fd, xdata);
return 0;
}