diff options
author | Soumya Koduri <skoduri@redhat.com> | 2018-11-09 02:29:52 -0500 |
---|---|---|
committer | Shyamsundar Ranganathan <srangana@redhat.com> | 2018-11-29 15:34:44 +0000 |
commit | c309e41f7750a1730c381f2c0a513507ba08dae4 (patch) | |
tree | e9c3a5b9da2f562cf17d5e1abd949367248c417d /xlators | |
parent | e504e9f97053b7b755aea49dc13a1e886c896b85 (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#1651322
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
(cherry picked from commit fda594875c4cdb2a22e27aa13f5c66bee032ccb5)
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/cluster/afr/src/afr-open.c | 4 |
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; } |