summaryrefslogtreecommitdiff
path: root/source3/modules/vfs_glusterfs.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2018-05-23 08:53:47 +0200
committerStefan Metzmacher <metze@samba.org>2018-06-14 20:52:23 +0200
commit55b1b5568f109f51d7cb3b707bc9ae761b3c44fa (patch)
treeea65941a419da8bde4032fc52ae9f2233da7887b /source3/modules/vfs_glusterfs.c
parentefce5587973f4b03ae63b20c7fd68c7daaf77c3a (diff)
downloadsamba-55b1b5568f109f51d7cb3b707bc9ae761b3c44fa.tar.gz
vfs_glusterfs: use tevent_req_defer_callback() in order to use the correct event context
The callback and _recv() functions should be called from the same event context that was passed to the _send() function. In future the completion pipe should be replaced by tevent_threaded_context_create() Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/modules/vfs_glusterfs.c')
-rw-r--r--source3/modules/vfs_glusterfs.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c
index 985a895257f..c2af793016f 100644
--- a/source3/modules/vfs_glusterfs.c
+++ b/source3/modules/vfs_glusterfs.c
@@ -803,6 +803,14 @@ static struct tevent_req *vfs_gluster_pread_send(struct vfs_handle_struct
return tevent_req_post(req, ev);
}
+ /*
+ * aio_glusterfs_done and aio_tevent_fd_done()
+ * use the raw tevent context. We need to use
+ * tevent_req_defer_callback() in order to
+ * use the event context we're started with.
+ */
+ tevent_req_defer_callback(req, ev);
+
PROFILE_TIMESTAMP(&state->start);
ret = glfs_pread_async(*(glfs_fd_t **)VFS_FETCH_FSP_EXTENSION(handle,
fsp), data, n, offset, 0, aio_glusterfs_done,
@@ -839,6 +847,14 @@ static struct tevent_req *vfs_gluster_pwrite_send(struct vfs_handle_struct
return tevent_req_post(req, ev);
}
+ /*
+ * aio_glusterfs_done and aio_tevent_fd_done()
+ * use the raw tevent context. We need to use
+ * tevent_req_defer_callback() in order to
+ * use the event context we're started with.
+ */
+ tevent_req_defer_callback(req, ev);
+
PROFILE_TIMESTAMP(&state->start);
ret = glfs_pwrite_async(*(glfs_fd_t **)VFS_FETCH_FSP_EXTENSION(handle,
fsp), data, n, offset, 0, aio_glusterfs_done,
@@ -941,6 +957,14 @@ static struct tevent_req *vfs_gluster_fsync_send(struct vfs_handle_struct
return tevent_req_post(req, ev);
}
+ /*
+ * aio_glusterfs_done and aio_tevent_fd_done()
+ * use the raw tevent context. We need to use
+ * tevent_req_defer_callback() in order to
+ * use the event context we're started with.
+ */
+ tevent_req_defer_callback(req, ev);
+
PROFILE_TIMESTAMP(&state->start);
ret = glfs_fsync_async(*(glfs_fd_t **)VFS_FETCH_FSP_EXTENSION(handle,
fsp), aio_glusterfs_done, state);