summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2020-02-27 16:34:51 -0800
committerJeremy Allison <jra@samba.org>2020-03-08 18:07:43 +0000
commite102908f112866d657b8c0cd6a5b217d070210c8 (patch)
tree6d21085fbce0d27467be3e4066f61244d890e3e4 /source3
parent594a435b33e8447625ca83b50daec2d08cf66d64 (diff)
downloadsamba-e102908f112866d657b8c0cd6a5b217d070210c8.tar.gz
s3: VFS: vfs_default. Pass in struct vfswrap_pread_state as the callback data to the subreq.
Find the req we're finishing off by looking inside vfswrap_pread_state. In a shutdown close the caller calls talloc_free(req), so we can't access it directly as callback data. The next commit will NULL out the vfswrap_pread_state->req pointer when a caller calls talloc_free(req), and the request is still in flight. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/modules/vfs_default.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 4bb4adf5f7e..b8c36180b7c 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -827,7 +827,7 @@ static struct tevent_req *vfswrap_pread_send(struct vfs_handle_struct *handle,
if (tevent_req_nomem(subreq, req)) {
return tevent_req_post(req, ev);
}
- tevent_req_set_callback(subreq, vfs_pread_done, req);
+ tevent_req_set_callback(subreq, vfs_pread_done, state);
talloc_set_destructor(state, vfs_pread_state_destructor);
@@ -868,10 +868,9 @@ static int vfs_pread_state_destructor(struct vfswrap_pread_state *state)
static void vfs_pread_done(struct tevent_req *subreq)
{
- struct tevent_req *req = tevent_req_callback_data(
- subreq, struct tevent_req);
- struct vfswrap_pread_state *state = tevent_req_data(
- req, struct vfswrap_pread_state);
+ struct vfswrap_pread_state *state = tevent_req_callback_data(
+ subreq, struct vfswrap_pread_state);
+ struct tevent_req *req = state->req;
int ret;
ret = pthreadpool_tevent_job_recv(subreq);