Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795042221; b=EGYUFRcGpq2LfXQiMGCWmWIIQYaJRmL+rz25ddZFeXC6lZtZ6e1VA+C2lMSE5afnqAS6 qZJltjF37zqhldQ2kPmQ6oZcvfSwvnMp3aQC6eEp9vSxnwyNqLlfpcJ5p38wKwwWlNQwF og2f/w64fbu+IaV5+hXOUA9HVfeSK3TbkHKxrjNMartAcgs+c8eEjhyRyvAERSYdAMJRS 3DC+te2aYCQT2NvVpnEY9FSY12C8pbBsfyswbKNie05c3cGum75m2Dth1Mb/6VbV/pjkh 7rz90ZStQzB0f/5Rmz/25DUV9nLCsAoehcsT+NdtgSmnF7iIpIdg4NnqMWXjBdnInBg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795042221; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=L473OWOMfEwUrKbFMl2/nACQJ3PmpljP8nTDBU9uCeE=; b=JHu5cCc9iUr3QBp2Mzy2uaA2mLIMsBI6VwExrBtmdWvu0/Vp9Sm7oaS3pRPn1sWBdRW3 v8vbfKDBX+L9iOnzd5n0SKv5S9/aP9hYONepD/Jwnab1OsT+x6OjP3g3PGyP9oPdOL8ub 319LIGBnCtoYpJgLzA12WUx2T1oeDV4dXFlDtD1qagOc6LSi+Fal3vuU1SqpfZjpouSMZ 7C4/7sjjgXcZlj+tCh1tiO5IhFIZvO1J46TY/d0LmXlOP5Obcxxzk0GDj8RaoztVakm0k YWMDvntQZuHXVfuwnnL/uQLW58yBwJJDfAsXVVty1gS6UQ7HCEvUqr75W/L5Z3oxTLQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=Fp63hT4B; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BA7F4606A31C; Wed, 18 Nov 2026 22:50:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=Fp63hT4B Received: by smtp.kernel.org (Postfix) with ESMTPSA id 131481F000C4; Wed, 18 Nov 2026 22:50:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795042221; bh=L473OWOMfEwUrKbFMl2/nACQJ3PmpljP8nTDBU9uCeE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Fp63hT4BnbdTeCYTvVm2mDoezxhAIxwZP3+PCIGjr6pKf+0Z/VyNGA6kkkPSIN06L HbaAuje68sZ/ceILsiMQkv9COBBGZIcEjRQ1ja9EOdVpILbX2girP2coiFj+ggTiWh oyGfFVEwn8VdUee3MdngbFXu3zeu6l/bF36xXw2I= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, ChenXiaoSong , Namjae Jeon , Steve French , Sasha Levin Subject: [PATCH 6.6 3093/3318] smb: move create_durable_req_v2 to common/smb2pdu.h Date: Wed, 18 Nov 2026 16:01:55 +0100 Message-ID: <20261118150452.816440806@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261118150313.527275416@linuxfoundation.org> References: <20261118150313.527275416@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: ChenXiaoSong [ Upstream commit 833a75fc9ecc3856a52223d8c245e52703e0a9f1 ] Modify the following places: - some fields in "struct create_durable_req_v2" -> struct durable_context_v2 - durable_context_v2 -> durable_context_v2_req - create_durable_v2 -> create_durable_req_v2 Then move duplicate definitions to common header file. Signed-off-by: ChenXiaoSong Acked-by: Namjae Jeon Signed-off-by: Steve French Stable-dep-of: bb0326a58060 ("ksmbd: report IPv4 and IPv6 addresses independently in iface query") Signed-off-by: Sasha Levin --- fs/smb/client/smb2pdu.c | 14 +++++++------- fs/smb/client/smb2pdu.h | 12 ------------ fs/smb/common/smb2pdu.h | 14 ++++++++++++++ fs/smb/server/smb2pdu.c | 8 ++++---- fs/smb/server/smb2pdu.h | 9 --------- 5 files changed, 25 insertions(+), 32 deletions(-) diff --git a/fs/smb/client/smb2pdu.c b/fs/smb/client/smb2pdu.c index dbc7e4936b4c0..a93421b8c3828 100644 --- a/fs/smb/client/smb2pdu.c +++ b/fs/smb/client/smb2pdu.c @@ -2458,21 +2458,21 @@ add_lease_context(struct TCP_Server_Info *server, return 0; } -static struct create_durable_v2 * +static struct create_durable_req_v2 * create_durable_v2_buf(struct cifs_open_parms *oparms) { struct cifs_fid *pfid = oparms->fid; - struct create_durable_v2 *buf; + struct create_durable_req_v2 *buf; - buf = kzalloc(sizeof(struct create_durable_v2), GFP_KERNEL); + buf = kzalloc(sizeof(struct create_durable_req_v2), GFP_KERNEL); if (!buf) return NULL; buf->ccontext.DataOffset = cpu_to_le16(offsetof - (struct create_durable_v2, dcontext)); - buf->ccontext.DataLength = cpu_to_le32(sizeof(struct durable_context_v2)); + (struct create_durable_req_v2, dcontext)); + buf->ccontext.DataLength = cpu_to_le32(sizeof(struct durable_context_v2_req)); buf->ccontext.NameOffset = cpu_to_le16(offsetof - (struct create_durable_v2, Name)); + (struct create_durable_req_v2, Name)); buf->ccontext.NameLength = cpu_to_le16(4); /* @@ -2542,7 +2542,7 @@ add_durable_v2_context(struct kvec *iov, unsigned int *num_iovec, iov[num].iov_base = create_durable_v2_buf(oparms); if (iov[num].iov_base == NULL) return -ENOMEM; - iov[num].iov_len = sizeof(struct create_durable_v2); + iov[num].iov_len = sizeof(struct create_durable_req_v2); *num_iovec = num + 1; return 0; } diff --git a/fs/smb/client/smb2pdu.h b/fs/smb/client/smb2pdu.h index f1548d2f4a8ad..d1a1e75ae7344 100644 --- a/fs/smb/client/smb2pdu.h +++ b/fs/smb/client/smb2pdu.h @@ -137,18 +137,6 @@ struct share_redirect_error_context_rsp { /* See MS-SMB2 2.2.13.2.11 */ /* Flags */ #define SMB2_DHANDLE_FLAG_PERSISTENT 0x00000002 -struct durable_context_v2 { - __le32 Timeout; - __le32 Flags; - __u64 Reserved; - __u8 CreateGuid[16]; -} __packed; - -struct create_durable_v2 { - struct create_context_hdr ccontext; - __u8 Name[8]; - struct durable_context_v2 dcontext; -} __packed; /* See MS-SMB2 2.2.13.2.12 */ struct durable_reconnect_context_v2 { diff --git a/fs/smb/common/smb2pdu.h b/fs/smb/common/smb2pdu.h index a5e2d759ec2a1..ead1f5e066bb2 100644 --- a/fs/smb/common/smb2pdu.h +++ b/fs/smb/common/smb2pdu.h @@ -1288,6 +1288,20 @@ struct create_mxac_req { __le64 Timestamp; } __packed; +/* See MS-SMB2 2.2.13.2.11 */ +struct durable_context_v2_req { + __le32 Timeout; + __le32 Flags; /* see SMB2_DHANDLE_FLAG_PERSISTENT */ + __u64 Reserved; + __u8 CreateGuid[16]; +} __packed; + +struct create_durable_req_v2 { + struct create_context_hdr ccontext; + __u8 Name[8]; + struct durable_context_v2_req dcontext; +} __packed; + /* See MS-SMB2 2.2.14.2.5 */ struct create_mxac_rsp { struct create_context_hdr ccontext; diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c index 20775992fccca..584d5356c0273 100644 --- a/fs/smb/server/smb2pdu.c +++ b/fs/smb/server/smb2pdu.c @@ -2888,7 +2888,7 @@ static int parse_durable_handle_context(struct ksmbd_work *work, durable_v2_blob = (struct create_durable_req_v2 *)context; ksmbd_debug(SMB, "Request for durable v2 open\n"); - dh_info->fp = ksmbd_lookup_fd_cguid(durable_v2_blob->CreateGuid); + dh_info->fp = ksmbd_lookup_fd_cguid(durable_v2_blob->dcontext.CreateGuid); if (dh_info->fp) { if (!memcmp(conn->ClientGUID, dh_info->fp->client_guid, SMB2_CLIENT_GUID_SIZE)) { @@ -2913,11 +2913,11 @@ static int parse_durable_handle_context(struct ksmbd_work *work, if ((lc && (lc->req_state & SMB2_LEASE_HANDLE_CACHING_LE)) || req_op_level == SMB2_OPLOCK_LEVEL_BATCH) { dh_info->CreateGuid = - durable_v2_blob->CreateGuid; + durable_v2_blob->dcontext.CreateGuid; dh_info->persistent = - le32_to_cpu(durable_v2_blob->Flags); + le32_to_cpu(durable_v2_blob->dcontext.Flags); dh_info->timeout = - le32_to_cpu(durable_v2_blob->Timeout); + le32_to_cpu(durable_v2_blob->dcontext.Timeout); dh_info->type = dh_idx; } break; diff --git a/fs/smb/server/smb2pdu.h b/fs/smb/server/smb2pdu.h index bbba41bf653b6..6bb30556850c8 100644 --- a/fs/smb/server/smb2pdu.h +++ b/fs/smb/server/smb2pdu.h @@ -66,15 +66,6 @@ struct preauth_integrity_info { /* Apple Defined Contexts */ #define SMB2_CREATE_AAPL "AAPL" -struct create_durable_req_v2 { - struct create_context_hdr ccontext; - __u8 Name[8]; - __le32 Timeout; - __le32 Flags; - __u8 Reserved[8]; - __u8 CreateGuid[16]; -} __packed; - #define DURABLE_HANDLE_MAX_TIMEOUT 300000 struct create_durable_reconn_req { -- 2.53.0