smb3: make query_on_disk_id open context consistent and move to common code
authorSteve French <stfrench@microsoft.com>
Fri, 28 Apr 2023 05:21:10 +0000 (00:21 -0500)
committerSteve French <stfrench@microsoft.com>
Sat, 29 Apr 2023 03:50:16 +0000 (22:50 -0500)
cifs and ksmbd were using a slightly different version of the query_on_disk_id
struct which could be confusing. Use the ksmbd version of this struct, and
move it to common code.

Reviewed-by: Paulo Alcantara (SUSE) <pc@manguebit.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/smb2pdu.c
fs/cifs/smb2pdu.h
fs/ksmbd/smb2pdu.h
fs/smbfs_common/smb2pdu.h

index 281e0b12658d81a6a4b11101ba9a11d6942fc1ef..0521aa1da644dd6fe33fd5eaec4af568b21dbf22 100644 (file)
@@ -2063,7 +2063,7 @@ create_reconnect_durable_buf(struct cifs_fid *fid)
 static void
 parse_query_id_ctxt(struct create_context *cc, struct smb2_file_all_info *buf)
 {
-       struct create_on_disk_id *pdisk_id = (struct create_on_disk_id *)cc;
+       struct create_disk_id_rsp *pdisk_id = (struct create_disk_id_rsp *)cc;
 
        cifs_dbg(FYI, "parse query id context 0x%llx 0x%llx\n",
                pdisk_id->DiskFileId, pdisk_id->VolumeId);
index 2114e8a0c63ae921e1ee478a6c050c65a806ca39..efe55a572e4c66fdde8ee54d427066315da79716 100644 (file)
@@ -170,15 +170,6 @@ struct durable_reconnect_context_v2 {
        __le32 Flags; /* see above DHANDLE_FLAG_PERSISTENT */
 } __packed;
 
-/* See MS-SMB2 2.2.14.2.9 */
-struct create_on_disk_id {
-       struct create_context ccontext;
-       __u8   Name[8];
-       __le64 DiskFileId;
-       __le64 VolumeId;
-       __u32  Reserved[4];
-} __packed;
-
 /* See MS-SMB2 2.2.14.2.12 */
 struct durable_reconnect_context_v2_rsp {
        __le32 Timeout;
index 9420dd2813fb782157a0ae7ebc41c9fa83d2cb76..bcf71fd4dc1ea42241e48add5d6bd4b155ad8760 100644 (file)
@@ -144,14 +144,6 @@ struct create_mxac_rsp {
        __le32 MaximalAccess;
 } __packed;
 
-struct create_disk_id_rsp {
-       struct create_context ccontext;
-       __u8   Name[8];
-       __le64 DiskFileId;
-       __le64 VolumeId;
-       __u8  Reserved[16];
-} __packed;
-
 /* equivalent of the contents of SMB3.1.1 POSIX open context response */
 struct create_posix_rsp {
        struct create_context ccontext;
index 334f11ed51468f980928c1792ce69ada75d986f7..43c92e898ee95ddb077d0ebf2d833b3717a1a228 100644 (file)
@@ -1181,6 +1181,7 @@ struct create_posix {
 
 #define SMB2_LEASE_KEY_SIZE                    16
 
+/* See MS-SMB2 2.2.13.2.8 */
 struct lease_context {
        __u8 LeaseKey[SMB2_LEASE_KEY_SIZE];
        __le32 LeaseState;
@@ -1188,6 +1189,7 @@ struct lease_context {
        __le64 LeaseDuration;
 } __packed;
 
+/* See MS-SMB2 2.2.13.2.10 */
 struct lease_context_v2 {
        __u8 LeaseKey[SMB2_LEASE_KEY_SIZE];
        __le32 LeaseState;
@@ -1211,6 +1213,15 @@ struct create_lease_v2 {
        __u8   Pad[4];
 } __packed;
 
+/* See MS-SMB2 2.2.14.2.9 */
+struct create_disk_id_rsp {
+       struct create_context ccontext;
+       __u8   Name[8];
+       __le64 DiskFileId;
+       __le64 VolumeId;
+       __u8  Reserved[16];
+} __packed;
+
 /* See MS-SMB2 2.2.31 and 2.2.32 */
 struct smb2_ioctl_req {
        struct smb2_hdr hdr;