smbd: add an effective {smb,smbd_smb2}_request->ev_ctx that holds the event context...
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:21 +0000 (08:59 +0200)
In future this will an impersonation wrapper tevent_context based on the
user session.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
25 files changed:
source3/include/vfs.h
source3/smbd/aio.c
source3/smbd/globals.h
source3/smbd/ipc.c
source3/smbd/open.c
source3/smbd/pipes.c
source3/smbd/process.c
source3/smbd/reply.c
source3/smbd/smb2_break.c
source3/smbd/smb2_close.c
source3/smbd/smb2_create.c
source3/smbd/smb2_flush.c
source3/smbd/smb2_getinfo.c
source3/smbd/smb2_glue.c
source3/smbd/smb2_ioctl.c
source3/smbd/smb2_ioctl_named_pipe.c
source3/smbd/smb2_lock.c
source3/smbd/smb2_notify.c
source3/smbd/smb2_query_directory.c
source3/smbd/smb2_read.c
source3/smbd/smb2_server.c
source3/smbd/smb2_sesssetup.c
source3/smbd/smb2_setinfo.c
source3/smbd/smb2_tcon.c
source3/smbd/smb2_write.c

index 249cf0697792cc085388d4dc28d24c3e83728ecf..4e5b78709034e30380b0b859ec45efbe3ff4033a 100644 (file)
@@ -514,6 +514,8 @@ struct smb_request {
 
        size_t unread_bytes;
        bool encrypted;
+       /* the tevent_context (wrapper) the request operates on */
+       struct tevent_context *ev_ctx;
        connection_struct *conn;
        struct smbd_server_connection *sconn;
        struct smbXsrv_connection *xconn;
index b984036e9f8e31a8eb6ca4c23e4e70a9f342b280..c066ea1a97886fcb9695540aa0cc495486c5a7ff 100644 (file)
@@ -206,7 +206,7 @@ NTSTATUS schedule_aio_read_and_X(connection_struct *conn,
        aio_ex->nbyte = smb_maxcnt;
        aio_ex->offset = startpos;
 
-       req = SMB_VFS_PREAD_SEND(aio_ex, fsp->conn->sconn->ev_ctx,
+       req = SMB_VFS_PREAD_SEND(aio_ex, smbreq->ev_ctx,
                                 fsp,
                                 smb_buf(aio_ex->outbuf.data) + 1 /* pad */,
                                 smb_maxcnt, startpos);
@@ -459,7 +459,7 @@ NTSTATUS schedule_aio_write_and_X(connection_struct *conn,
        aio_ex->nbyte = numtowrite;
        aio_ex->offset = startpos;
 
-       req = pwrite_fsync_send(aio_ex, fsp->conn->sconn->ev_ctx, fsp,
+       req = pwrite_fsync_send(aio_ex, smbreq->ev_ctx, fsp,
                                data, numtowrite, startpos,
                                aio_ex->write_through);
        if (req == NULL) {
@@ -701,7 +701,7 @@ NTSTATUS schedule_smb2_aio_read(connection_struct *conn,
        aio_ex->nbyte = smb_maxcnt;
        aio_ex->offset = startpos;
 
-       req = SMB_VFS_PREAD_SEND(aio_ex, fsp->conn->sconn->ev_ctx, fsp,
+       req = SMB_VFS_PREAD_SEND(aio_ex, smbreq->ev_ctx, fsp,
                                 preadbuf->data, smb_maxcnt, startpos);
        if (req == NULL) {
                DEBUG(0, ("smb2: SMB_VFS_PREAD_SEND failed. "
@@ -850,7 +850,7 @@ NTSTATUS schedule_aio_smb2_write(connection_struct *conn,
        aio_ex->nbyte = in_data.length;
        aio_ex->offset = in_offset;
 
-       req = pwrite_fsync_send(aio_ex, fsp->conn->sconn->ev_ctx, fsp,
+       req = pwrite_fsync_send(aio_ex, smbreq->ev_ctx, fsp,
                                in_data.data, in_data.length, in_offset,
                                write_through);
        if (req == NULL) {
index 1ac1b47b9d32246b2f7ea9822074b0081cfb082d..7d7058727bfb20b37d6b689881ae5e7b0b84dfc9 100644 (file)
@@ -701,6 +701,9 @@ struct smbd_smb2_request {
        struct smbXsrv_tcon *tcon;
        uint32_t last_tid;
 
+       /* the tevent_context (wrapper) the request operates on */
+       struct tevent_context *ev_ctx;
+
        int current_idx;
        bool do_signing;
        /* Was the request encrypted? */
index f1c8ea0c2ed43d3e3e4740a10ce36dd458f04bb0..85236e0102f28ab524d6f98f255410e22b475902 100644 (file)
@@ -281,7 +281,7 @@ static void api_dcerpc_cmd(connection_struct *conn, struct smb_request *req,
        state->num_data = length;
        state->max_read = max_read;
 
-       subreq = np_write_send(state, req->sconn->ev_ctx, state->handle,
+       subreq = np_write_send(state, req->ev_ctx, state->handle,
                               state->data, length);
        if (subreq == NULL) {
                TALLOC_FREE(state);
@@ -330,7 +330,7 @@ static void api_dcerpc_cmd_write_done(struct tevent_req *subreq)
                goto send;
        }
 
-       subreq = np_read_send(state, req->sconn->ev_ctx,
+       subreq = np_read_send(state, req->ev_ctx,
                              state->handle, state->data, state->max_read);
        if (subreq == NULL) {
                reply_nterror(req, NT_STATUS_NO_MEMORY);
index 4b28e7ff9a26056aa6a532874ca4f9e146eee28b..db5eb4e459b64dae3ff8ffc13de2de2ac9bfbb2c 100644 (file)
@@ -2408,7 +2408,7 @@ static void defer_open(struct share_mode_lock *lck,
        DBG_DEBUG("defering mid %" PRIu64 "\n", req->mid);
 
        watch_req = dbwrap_watched_watch_send(watch_state,
-                                             req->sconn->ev_ctx,
+                                             req->ev_ctx,
                                              lck->data->record,
                                              (struct server_id){0});
        if (watch_req == NULL) {
@@ -2416,7 +2416,7 @@ static void defer_open(struct share_mode_lock *lck,
        }
        tevent_req_set_callback(watch_req, defer_open_done, watch_state);
 
-       ok = tevent_req_set_endtime(watch_req, req->sconn->ev_ctx, abs_timeout);
+       ok = tevent_req_set_endtime(watch_req, req->ev_ctx, abs_timeout);
        if (!ok) {
                exit_server("tevent_req_set_endtime failed");
        }
@@ -2508,7 +2508,7 @@ static void setup_kernel_oplock_poll_open(struct timeval request_time,
         * As this timer event is owned by req, it will
         * disappear if req it talloc_freed.
         */
-       open_rec->te = tevent_add_timer(req->sconn->ev_ctx,
+       open_rec->te = tevent_add_timer(req->ev_ctx,
                                        req,
                                        timeval_current_ofs(1, 0),
                                        kernel_oplock_poll_open_timer,
@@ -2695,7 +2695,7 @@ static void schedule_async_open(struct timeval request_time,
                exit_server("push_deferred_open_message_smb failed");
        }
 
-       open_rec->te = tevent_add_timer(req->sconn->ev_ctx,
+       open_rec->te = tevent_add_timer(req->ev_ctx,
                                        req,
                                        timeval_current_ofs(20, 0),
                                        schedule_async_open_timer,
index 4be57bc2a5f0dea80515419bdaa2d8763be60958..c945f0f6177661259262c04f1881375b0a95d8be 100644 (file)
@@ -67,7 +67,7 @@ NTSTATUS open_np_file(struct smb_request *smb_req, const char *name,
                         conn->sconn->remote_address,
                         conn->sconn->local_address,
                         conn->session_info,
-                        conn->sconn->ev_ctx,
+                        smb_req->ev_ctx,
                         conn->sconn->msg_ctx,
                         &fsp->fake_file_handle);
        if (!NT_STATUS_IS_OK(status)) {
@@ -206,7 +206,7 @@ void reply_pipe_write(struct smb_request *req)
        DEBUG(6, ("reply_pipe_write: %s, name: %s len: %d\n", fsp_fnum_dbg(fsp),
                  fsp_str_dbg(fsp), (int)state->numtowrite));
 
-       subreq = np_write_send(state, req->sconn->ev_ctx,
+       subreq = np_write_send(state, req->ev_ctx,
                               fsp->fake_file_handle, data, state->numtowrite);
        if (subreq == NULL) {
                TALLOC_FREE(state);
@@ -322,7 +322,7 @@ void reply_pipe_write_and_X(struct smb_request *req)
                state->numtowrite -= 2;
        }
 
-       subreq = np_write_send(state, req->sconn->ev_ctx,
+       subreq = np_write_send(state, req->ev_ctx,
                               fsp->fake_file_handle, data, state->numtowrite);
        if (subreq == NULL) {
                TALLOC_FREE(state);
@@ -435,7 +435,7 @@ void reply_pipe_read_and_X(struct smb_request *req)
        state->outbuf = req->outbuf;
        req->outbuf = NULL;
 
-       subreq = np_read_send(state, req->sconn->ev_ctx,
+       subreq = np_read_send(state, req->ev_ctx,
                              fsp->fake_file_handle, data,
                              state->smb_maxcnt);
        if (subreq == NULL) {
index d2553049cd2568e24e78e39f43c374d95a0825e6..e730676ef3615b38f51b2deab50216207e68100f 100644 (file)
@@ -1506,6 +1506,8 @@ static connection_struct *switch_message(uint8_t type, struct smb_request *req)
 
        errno = 0;
 
+       req->ev_ctx = NULL;
+
        if (!xconn->smb1.negprot.done) {
                switch (type) {
                        /*
@@ -1640,6 +1642,8 @@ static connection_struct *switch_message(uint8_t type, struct smb_request *req)
                        reply_nterror(req, NT_STATUS_ACCESS_DENIED);
                        return conn;
                }
+
+               req->ev_ctx = conn->user_ev_ctx;
        } else if (flags & AS_GUEST) {
                /*
                 * Does this protocol need to be run as guest? (Only archane
@@ -1649,9 +1653,13 @@ static connection_struct *switch_message(uint8_t type, struct smb_request *req)
                        reply_nterror(req, NT_STATUS_ACCESS_DENIED);
                        return conn;
                }
+
+               req->ev_ctx = req->sconn->guest_ev_ctx;
        } else {
                /* This call needs to be run as root */
                change_to_root_user();
+
+               req->ev_ctx = req->sconn->root_ev_ctx;
        }
 
        /* load service specific parameters */
index 1b99664cbd8bdbcb6238684d9a97509cca396d0c..5afe57d11cb7cf8c31397ea0181bd4357d8ba231 100644 (file)
@@ -5392,7 +5392,7 @@ void reply_close(struct smb_request *req)
                 */
 
                fsp->deferred_close = tevent_wait_send(
-                       fsp, fsp->conn->sconn->ev_ctx);
+                       fsp, req->ev_ctx);
                if (fsp->deferred_close == NULL) {
                        status = NT_STATUS_NO_MEMORY;
                        goto done;
index 86529ed2e1f8f27b952025012f05ef6917aa9dd6..21fbef42dcedcd448ebfcb61b46c1d36ea492d51 100644 (file)
@@ -86,7 +86,7 @@ NTSTATUS smbd_smb2_request_process_break(struct smbd_smb2_request *req)
                return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER);
        }
 
-       subreq = smbd_smb2_oplock_break_send(req, req->sconn->ev_ctx,
+       subreq = smbd_smb2_oplock_break_send(req, req->ev_ctx,
                                             req, in_fsp, in_oplock_level);
        if (subreq == NULL) {
                return smbd_smb2_request_error(req, NT_STATUS_NO_MEMORY);
@@ -265,7 +265,7 @@ static NTSTATUS smbd_smb2_request_process_lease_break(
        in_lease_key.data[1] = BVAL(inbody, 16);
        in_lease_state = IVAL(inbody, 24);
 
-       subreq = smbd_smb2_lease_break_send(req, req->sconn->ev_ctx, req,
+       subreq = smbd_smb2_lease_break_send(req, req->ev_ctx, req,
                                            in_lease_key, in_lease_state);
        if (subreq == NULL) {
                return smbd_smb2_request_error(req, NT_STATUS_NO_MEMORY);
index 992b52929ec419000bd0f02d239407f52d0d6e4d..33863d32f5f2e82d21442900f8e85f7dc4e3697d 100644 (file)
@@ -70,7 +70,7 @@ NTSTATUS smbd_smb2_request_process_close(struct smbd_smb2_request *req)
                return smbd_smb2_request_error(req, NT_STATUS_FILE_CLOSED);
        }
 
-       subreq = smbd_smb2_close_send(req, req->sconn->ev_ctx,
+       subreq = smbd_smb2_close_send(req, req->ev_ctx,
                                      req, in_fsp, in_flags);
        if (subreq == NULL) {
                return smbd_smb2_request_error(req, NT_STATUS_NO_MEMORY);
index 3f38af5dde27a55d6434f589c9290eff4d6479f6..8fbea238698c7e4f89c9a13464d0d39e79b86f61 100644 (file)
@@ -228,7 +228,7 @@ NTSTATUS smbd_smb2_request_process_create(struct smbd_smb2_request *smb2req)
        }
 
        tsubreq = smbd_smb2_create_send(smb2req,
-                                      smb2req->sconn->ev_ctx,
+                                      smb2req->ev_ctx,
                                       smb2req,
                                       in_oplock_level,
                                       in_impersonation_level,
@@ -1763,7 +1763,7 @@ bool schedule_deferred_open_message_smb2(
                (unsigned long long)mid ));
 
        tevent_schedule_immediate(state->im,
-                       smb2req->sconn->ev_ctx,
+                       smb2req->ev_ctx,
                        smbd_smb2_create_request_dispatch_immediate,
                        smb2req);
 
@@ -1795,7 +1795,7 @@ static bool smbd_smb2_create_cancel(struct tevent_req *req)
 
        remove_deferred_open_message_smb2_internal(smb2req, mid);
 
-       tevent_req_defer_callback(req, smb2req->sconn->ev_ctx);
+       tevent_req_defer_callback(req, smb2req->ev_ctx);
        tevent_req_nterror(req, NT_STATUS_CANCELLED);
        return true;
 }
index 470a8df494420215d0aaeb7c85611dc3a90e79e6..4f815a6f5b0c57df164bb97e02e59dafc4a202b7 100644 (file)
@@ -58,7 +58,7 @@ NTSTATUS smbd_smb2_request_process_flush(struct smbd_smb2_request *req)
                return smbd_smb2_request_error(req, NT_STATUS_FILE_CLOSED);
        }
 
-       subreq = smbd_smb2_flush_send(req, req->sconn->ev_ctx,
+       subreq = smbd_smb2_flush_send(req, req->ev_ctx,
                                      req, in_fsp);
        if (subreq == NULL) {
                return smbd_smb2_request_error(req, NT_STATUS_NO_MEMORY);
index 694e9f83b754d501c2e1a1e92c29631f60cf4e19..da82bf5237871a137e8be7742358f4e3e851841d 100644 (file)
@@ -120,7 +120,7 @@ NTSTATUS smbd_smb2_request_process_getinfo(struct smbd_smb2_request *req)
                return smbd_smb2_request_error(req, NT_STATUS_FILE_CLOSED);
        }
 
-       subreq = smbd_smb2_getinfo_send(req, req->sconn->ev_ctx,
+       subreq = smbd_smb2_getinfo_send(req, req->ev_ctx,
                                        req, in_fsp,
                                        in_info_type,
                                        in_file_info_class,
index 6a73ec050e246139cc688f3ac323916168394457..cccc763c3425a011a544a0182eaf4bda43973595 100644 (file)
@@ -46,6 +46,7 @@ struct smb_request *smbd_smb2_fake_smb_request(struct smbd_smb2_request *req)
        smbreq->conn = req->tcon->compat;
        smbreq->sconn = req->sconn;
        smbreq->xconn = req->xconn;
+       smbreq->ev_ctx = req->ev_ctx;
        smbreq->smbpid = (uint16_t)IVAL(inhdr, SMB2_HDR_PID);
        smbreq->flags2 = FLAGS2_UNICODE_STRINGS |
                         FLAGS2_32_BIT_ERROR_CODES |
index be70e3a091285e44407394d67a023b7b34787efa..451733c1a6593186c5b3c030a89542e34d72d046 100644 (file)
@@ -217,7 +217,7 @@ NTSTATUS smbd_smb2_request_process_ioctl(struct smbd_smb2_request *req)
                break;
        }
 
-       subreq = smbd_smb2_ioctl_send(req, req->sconn->ev_ctx,
+       subreq = smbd_smb2_ioctl_send(req, req->ev_ctx,
                                      req, in_fsp,
                                      in_ctl_code,
                                      in_input_buffer,
index f9e3dec049c087eebbbc7d3ce452cb6e95205189..f8012ae1920346c0b30eba9e18930c6ebd0e0347 100644 (file)
@@ -143,7 +143,7 @@ static void smbd_smb2_ioctl_pipe_write_done(struct tevent_req *subreq)
                (unsigned int)state->out_output.length ));
 
        subreq = np_read_send(state->smbreq->conn,
-                             state->smb2req->sconn->ev_ctx,
+                             state->smb2req->ev_ctx,
                              state->fsp->fake_file_handle,
                              state->out_output.data,
                              state->out_output.length);
index 3cc591089a42a5df7f0f51edf7247874b08b9c2a..da5a54df623349c15e38ea829ff0384559c84a1e 100644 (file)
@@ -134,7 +134,7 @@ NTSTATUS smbd_smb2_request_process_lock(struct smbd_smb2_request *req)
                return smbd_smb2_request_error(req, NT_STATUS_FILE_CLOSED);
        }
 
-       subreq = smbd_smb2_lock_send(req, req->sconn->ev_ctx,
+       subreq = smbd_smb2_lock_send(req, req->ev_ctx,
                                     req, in_fsp,
                                     in_lock_count,
                                     in_locks);
@@ -368,7 +368,7 @@ static struct tevent_req *smbd_smb2_lock_send(TALLOC_CTX *mem_ctx,
        }
 
        if (async) {
-               tevent_req_defer_callback(req, smb2req->sconn->ev_ctx);
+               tevent_req_defer_callback(req, smb2req->ev_ctx);
                SMBPROFILE_IOBYTES_ASYNC_SET_IDLE(smb2req->profile);
                return req;
        }
index 242415625567f070e83d6ea66ecb0bbfeec3a5ac..e49e76d9641316da147a18ff91e363a9b2fde325 100644 (file)
@@ -94,7 +94,7 @@ NTSTATUS smbd_smb2_request_process_notify(struct smbd_smb2_request *req)
                return smbd_smb2_request_error(req, NT_STATUS_FILE_CLOSED);
        }
 
-       subreq = smbd_smb2_notify_send(req, req->sconn->ev_ctx,
+       subreq = smbd_smb2_notify_send(req, req->ev_ctx,
                                       req, in_fsp,
                                       in_flags,
                                       in_output_buffer_length,
@@ -355,7 +355,7 @@ static void smbd_smb2_notify_reply(struct smb_request *smbreq,
                }
        }
 
-       tevent_req_defer_callback(req, state->smb2req->sconn->ev_ctx);
+       tevent_req_defer_callback(req, state->smb2req->ev_ctx);
 
        if (!NT_STATUS_IS_OK(state->status)) {
                tevent_req_nterror(req, state->status);
index 700f43e31262928e362e7a3003bb2641a1118bb9..50a5bca5d7b2ba1fad44599380f6f122ef8664c3 100644 (file)
@@ -124,7 +124,7 @@ NTSTATUS smbd_smb2_request_process_query_directory(struct smbd_smb2_request *req
                return smbd_smb2_request_error(req, NT_STATUS_FILE_CLOSED);
        }
 
-       subreq = smbd_smb2_query_directory_send(req, req->sconn->ev_ctx,
+       subreq = smbd_smb2_query_directory_send(req, req->ev_ctx,
                                     req, in_fsp,
                                     in_file_info_class,
                                     in_flags,
index a7d2496bc6f30e4a7f425fa9fe9a0d53116f1b66..065a5cd5fc69b6ddd1ca3257113d3aec4821de1a 100644 (file)
@@ -97,7 +97,7 @@ NTSTATUS smbd_smb2_request_process_read(struct smbd_smb2_request *req)
                return smbd_smb2_request_error(req, NT_STATUS_FILE_CLOSED);
        }
 
-       subreq = smbd_smb2_read_send(req, req->sconn->ev_ctx,
+       subreq = smbd_smb2_read_send(req, req->ev_ctx,
                                     req, in_fsp,
                                     in_flags,
                                     in_length,
index 46b747cabffa96f1133a559fb03a0b16eec1ea44..0c1ac32389180709535911527abc9288458c8a51 100644 (file)
@@ -2614,8 +2614,10 @@ NTSTATUS smbd_smb2_request_dispatch(struct smbd_smb2_request *req)
                SMB_ASSERT(call->fileid_ofs == 0);
                /* This call needs to be run as root */
                change_to_root_user();
+               req->ev_ctx = req->sconn->root_ev_ctx;
        } else {
                SMB_ASSERT(call->need_tcon);
+               req->ev_ctx = req->tcon->compat->user_ev_ctx;
        }
 
 #define _INBYTES(_r) \
index 5e1e8b4ec57956e4e805d5b3ade90cd18e7978ac..fe5835b83f34c070c69a563d9ac260907214e142 100644 (file)
@@ -95,7 +95,7 @@ NTSTATUS smbd_smb2_request_process_sesssetup(struct smbd_smb2_request *smb2req)
        in_security_buffer.length = in_security_length;
 
        subreq = smbd_smb2_session_setup_wrap_send(smb2req,
-                                                  smb2req->sconn->ev_ctx,
+                                                  smb2req->ev_ctx,
                                                   smb2req,
                                                   in_session_id,
                                                   in_flags,
@@ -1218,7 +1218,7 @@ NTSTATUS smbd_smb2_request_process_logoff(struct smbd_smb2_request *req)
                return smbd_smb2_request_error(req, status);
        }
 
-       subreq = smbd_smb2_logoff_send(req, req->sconn->ev_ctx, req);
+       subreq = smbd_smb2_logoff_send(req, req->ev_ctx, req);
        if (subreq == NULL) {
                return smbd_smb2_request_error(req, NT_STATUS_NO_MEMORY);
        }
index 4958bb8f16e7a1648ea7bb0ec3be18e22b86becf..5a6a28a323e25f207a7051d25243695621a7eba7 100644 (file)
@@ -107,7 +107,7 @@ NTSTATUS smbd_smb2_request_process_setinfo(struct smbd_smb2_request *req)
                return smbd_smb2_request_error(req, NT_STATUS_FILE_CLOSED);
        }
 
-       subreq = smbd_smb2_setinfo_send(req, req->sconn->ev_ctx,
+       subreq = smbd_smb2_setinfo_send(req, req->ev_ctx,
                                        req, in_fsp,
                                        in_info_type,
                                        in_file_info_class,
index ebd31602efcd8b2349f2e81fe2c1ac29e756e0eb..3a4a15d3059ecc3229d4163ba1499ebdb659792e 100644 (file)
@@ -94,7 +94,7 @@ NTSTATUS smbd_smb2_request_process_tcon(struct smbd_smb2_request *req)
        }
 
        subreq = smbd_smb2_tree_connect_send(req,
-                                            req->sconn->ev_ctx,
+                                            req->ev_ctx,
                                             req,
                                             in_path_string);
        if (subreq == NULL) {
@@ -491,7 +491,7 @@ NTSTATUS smbd_smb2_request_process_tdis(struct smbd_smb2_request *req)
                return smbd_smb2_request_error(req, status);
        }
 
-       subreq = smbd_smb2_tdis_send(req, req->sconn->ev_ctx, req);
+       subreq = smbd_smb2_tdis_send(req, req->ev_ctx, req);
        if (subreq == NULL) {
                return smbd_smb2_request_error(req, NT_STATUS_NO_MEMORY);
        }
index ee95bd317aefff1ad614b446ec6e179ab4918f07..d5ab12ecc21ac8ab8292a0f1b2c31f582de552b7 100644 (file)
@@ -109,7 +109,7 @@ NTSTATUS smbd_smb2_request_process_write(struct smbd_smb2_request *req)
                return smbd_smb2_request_error(req, NT_STATUS_FILE_CLOSED);
        }
 
-       subreq = smbd_smb2_write_send(req, req->sconn->ev_ctx,
+       subreq = smbd_smb2_write_send(req, req->ev_ctx,
                                      req, in_fsp,
                                      in_data_buffer,
                                      in_offset,