diff --git a/source3/smbd/smb2_ioctl_filesys.c b/source3/smbd/smb2_ioctl_filesys.c index 8a9c8c64ec9..a5d94de9b7e 100644 --- a/source3/smbd/smb2_ioctl_filesys.c +++ b/source3/smbd/smb2_ioctl_filesys.c @@ -795,6 +795,11 @@ struct tevent_req *smb2_ioctl_filesys(uint32_t ctl_code, tevent_req_set_callback(subreq, smb2_ioctl_filesys_dup_extents_done, req); + /* Ensure any close request knows about this outstanding IO. */ + if (!aio_add_req_to_fsp(state->fsp, req)) { + tevent_req_nterror(req, NT_STATUS_NO_MEMORY); + return tevent_req_post(req, ev); + } return req; break; } diff --git a/source3/smbd/smb2_ioctl_network_fs.c b/source3/smbd/smb2_ioctl_network_fs.c index 8154fa3f92e..057251f2796 100644 --- a/source3/smbd/smb2_ioctl_network_fs.c +++ b/source3/smbd/smb2_ioctl_network_fs.c @@ -544,6 +544,11 @@ struct tevent_req *smb2_ioctl_network_fs(uint32_t ctl_code, tevent_req_set_callback(subreq, smb2_ioctl_network_fs_copychunk_done, req); + /* Ensure any close request knows about this outstanding IO. */ + if (!aio_add_req_to_fsp(state->fsp, req)) { + tevent_req_nterror(req, NT_STATUS_NO_MEMORY); + return tevent_req_post(req, ev); + } return req; break; case FSCTL_QUERY_NETWORK_INTERFACE_INFO: @@ -592,6 +597,11 @@ struct tevent_req *smb2_ioctl_network_fs(uint32_t ctl_code, } tevent_req_set_callback( subreq, smb2_ioctl_network_fs_offload_read_done, req); + /* Ensure any close request knows about this outstanding IO. */ + if (!aio_add_req_to_fsp(state->fsp, req)) { + tevent_req_nterror(req, NT_STATUS_NO_MEMORY); + return tevent_req_post(req, ev); + } return req; default: {