From 462b74da79c51f9ba6dbd24e603aa904485d5123 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 17 Jun 2024 10:41:53 +0200 Subject: [PATCH] vfs_default: also call vfs_offload_token_ctx_init in vfswrap_offload_write_send If a client for whatever reason calls FSCTL_SRV_COPYCHUNK[_WRITE] without FSCTL_SRV_REQUEST_RESUME_KEY, we call vfswrap_offload_write_send before vfswrap_offload_read_send. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15664 Signed-off-by: Stefan Metzmacher Reviewed-by: Noel Power Autobuild-User(master): Stefan Metzmacher Autobuild-Date(master): Mon Jun 17 18:02:27 UTC 2024 on atb-devel-224 --- selftest/knownfail.d/smb2.ioctl.copy_chunk | 1 - source3/modules/vfs_default.c | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) delete mode 100644 selftest/knownfail.d/smb2.ioctl.copy_chunk diff --git a/selftest/knownfail.d/smb2.ioctl.copy_chunk b/selftest/knownfail.d/smb2.ioctl.copy_chunk deleted file mode 100644 index 56e8e2caf58..00000000000 --- a/selftest/knownfail.d/smb2.ioctl.copy_chunk +++ /dev/null @@ -1 +0,0 @@ -^samba3.smb2.ioctl.*.copy_chunk_bug15644 diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index 48b5dd9e39f..e0ebc7bd1a2 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -2148,6 +2148,12 @@ static struct tevent_req *vfswrap_offload_write_send( .remaining = to_copy, }; + status = vfs_offload_token_ctx_init(handle->conn->sconn->client, + &vfswrap_offload_ctx); + if (tevent_req_nterror(req, status)) { + return tevent_req_post(req, ev); + } + tevent_req_set_cleanup_fn(req, vfswrap_offload_write_cleanup); switch (fsctl) { -- 2.47.2