summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2016-08-02 15:19:00 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2016-08-17 04:44:11 -0700
commit318aacabbc482bcc2e1686988a77ad0bc054837e (patch)
tree3fae53e726d8eb2fa9d6ce674a26367ea6c9af70
parente65e066c4f993aac626112e718ee66d35d15c6a8 (diff)
cluster/afr: copy loc before passing to syncop
Problem: When io-threads is enabled on the client side, io-threads destroys the call-stub in which the loc is stored as soon as the c-stack unwinds. Because afr is creating a syncop with the address of loc passed in setxattr by the time syncop tries to access it, io-threads would have already freed the call-stub. This will lead to crash. Fix: Copy loc to frame->local and use it's address. > Reviewed-on: http://review.gluster.org/15070 > Smoke: Gluster Build System <jenkins@build.gluster.org> > CentOS-regression: Gluster Build System <jenkins@build.gluster.org> > NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> > Reviewed-by: Ravishankar N <ravishankar@redhat.com> BUG: 1367305 Change-Id: I16987e491e24b0b4e3d868a6968e802e47c77f7a Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Signed-off-by: Oleksandr Natalenko <oleksandr@natalenko.name> Reviewed-on: http://review.gluster.org/15168 Reviewed-by: Ravishankar N <ravishankar@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
-rw-r--r--xlators/cluster/afr/src/afr-inode-write.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/xlators/cluster/afr/src/afr-inode-write.c b/xlators/cluster/afr/src/afr-inode-write.c
index 04067f589a5..c8335967c04 100644
--- a/xlators/cluster/afr/src/afr-inode-write.c
+++ b/xlators/cluster/afr/src/afr-inode-write.c
@@ -1415,7 +1415,8 @@ afr_handle_split_brain_commands (xlator_t *this, call_frame_t *frame,
}
data->spb_child_index = spb_child_index;
data->frame = frame;
- data->loc = loc;
+ loc_copy (&local->loc, loc);
+ data->loc = &local->loc;
ret = synctask_new (this->ctx->env,
afr_can_set_split_brain_choice,
afr_set_split_brain_choice, NULL, data);