summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendrabhat@gluster.com>2011-10-10 16:25:46 +0530
committerVijay Bellur <vijay@gluster.com>2011-10-10 04:04:15 -0700
commitc27db314b8f32b9bf4c3c6ce72edb16a25a7f4b8 (patch)
tree949d931b5e6c077d89b34e9f71bc5e959e43ab00
parent9b4716d8ed176ab23d6079e671a3fb7539a40d7e (diff)
libglusterfs/syncop: do not rely on synctask set in makecontext
Across glibc implementations, interpretation of argc/argv passed to makecontext() is different. This patch does away with dependence on such arguments passed to makecontext(). Instead,synctask reference is retrieved from pthread_getspecific(). Change-Id: I31533a8175ee19696e44736f1c162170f1c2c1c0 BUG: 3636 Reviewed-on: http://review.gluster.com/572 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
-rw-r--r--libglusterfs/src/syncop.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libglusterfs/src/syncop.c b/libglusterfs/src/syncop.c
index 61bb28c5d..523720072 100644
--- a/libglusterfs/src/syncop.c
+++ b/libglusterfs/src/syncop.c
@@ -97,10 +97,15 @@ synctask_wake (struct synctask *task)
void
-synctask_wrap (struct synctask *task)
+synctask_wrap (struct synctask *old_task)
{
int ret;
+ struct synctask *task = NULL;
+
+ /* Do not trust the pointer received. It may be
+ wrong and can lead to crashes. */
+ task = synctask_get ();
ret = task->syncfn (task->opaque);
task->synccbk (ret, task->opaque);