summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendrabhat@gluster.com>2011-10-10 16:20:17 +0530
committerVijay Bellur <vijay@gluster.com>2011-10-10 04:03:55 -0700
commite56c6f594b5f8b3453e331c9ec5963f727240bb4 (patch)
tree0280834f176a5032b8f19528ab3df575e251f8aa /libglusterfs
parent2cd86f11dda8bb377718b0d3e04924ee8f79cb59 (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: Ib00924ddb115877c643818e22afa8941eceaff76 BUG: 3636 Reviewed-on: http://review.gluster.com/571 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/syncop.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libglusterfs/src/syncop.c b/libglusterfs/src/syncop.c
index f8709455b..3ed5405af 100644
--- a/libglusterfs/src/syncop.c
+++ b/libglusterfs/src/syncop.c
@@ -97,9 +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);