mirror of
https://github.com/samba-team/samba.git
synced 2025-02-02 09:47:23 +03:00
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>
This commit is contained in:
parent
594a435b33
commit
e102908f11
@ -827,7 +827,7 @@ static struct tevent_req *vfswrap_pread_send(struct vfs_handle_struct *handle,
|
|||||||
if (tevent_req_nomem(subreq, req)) {
|
if (tevent_req_nomem(subreq, req)) {
|
||||||
return tevent_req_post(req, ev);
|
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);
|
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)
|
static void vfs_pread_done(struct tevent_req *subreq)
|
||||||
{
|
{
|
||||||
struct tevent_req *req = tevent_req_callback_data(
|
struct vfswrap_pread_state *state = tevent_req_callback_data(
|
||||||
subreq, struct tevent_req);
|
subreq, struct vfswrap_pread_state);
|
||||||
struct vfswrap_pread_state *state = tevent_req_data(
|
struct tevent_req *req = state->req;
|
||||||
req, struct vfswrap_pread_state);
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = pthreadpool_tevent_job_recv(subreq);
|
ret = pthreadpool_tevent_job_recv(subreq);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user