summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/syncop.c
diff options
context:
space:
mode:
Diffstat (limited to 'libglusterfs/src/syncop.c')
-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);