vfs_glusterfs: explain that/why we use the raw tevent_context in init_gluster_aio()
authorStefan Metzmacher <metze@samba.org>
Thu, 22 Mar 2018 09:54:41 +0000 (10:54 +0100)
committerStefan Metzmacher <metze@samba.org>
Mon, 18 Jun 2018 06:59:19 +0000 (08:59 +0200)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/modules/vfs_glusterfs.c

index c2af793016f208404b397fc44e2289714504131e..02289a64e5051aa57321441bdcd011c430e98ff3 100644 (file)
@@ -729,7 +729,16 @@ static bool init_gluster_aio(struct vfs_handle_struct *handle)
        read_fd = fds[0];
        write_fd = fds[1];
 
-       aio_read_event = tevent_add_fd(handle->conn->sconn->ev_ctx,
+       /*
+        * We use the raw tevent context here,
+        * as this is a global event handler.
+        *
+        * The tevent_req_defer_callback()
+        * calls will make sure the results
+        * of async calls are propagated
+        * to the correct tevent_context.
+        */
+       aio_read_event = tevent_add_fd(handle->conn->sconn->raw_ev_ctx,
                                        NULL,
                                        read_fd,
                                        TEVENT_FD_READ,