path: root/libglusterfs/src/syncop.c
diff options
authorRaghavendra Bhat <>2011-10-01 19:20:28 +0530
committerVijay Bellur <>2011-10-02 01:31:18 -0700
commit0db88567b916dc0dbfb0dfe2ed8a47f8d50fb317 (patch)
tree925dfc5c2af0491d052b494c91d2b26728450938 /libglusterfs/src/syncop.c
parent9ef8eabae21a3073f3dc09602d0680d631cbd576 (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: Ie01feaa0b7d430f8782c2f6805ccdf8026e401f4 BUG: 3636 Reviewed-on: Tested-by: Gluster Build System <> Reviewed-by: Amar Tumballi <> Reviewed-by: Vijay Bellur <>
Diffstat (limited to 'libglusterfs/src/syncop.c')
1 files changed, 6 insertions, 1 deletions
diff --git a/libglusterfs/src/syncop.c b/libglusterfs/src/syncop.c
index bbcf520..1380d15 100644
--- a/libglusterfs/src/syncop.c
+++ b/libglusterfs/src/syncop.c
@@ -97,10 +97,15 @@ synctask_wake (struct synctask *task)
-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->frame, task->opaque);