Skip to content

Commit 1149c84

Browse files
committed
smb3: make query_on_disk_id open context consistent and move to common code
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) <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent c09ba02 commit 1149c84

File tree

4 files changed

+12
-18
lines changed

4 files changed

+12
-18
lines changed

fs/cifs/smb2pdu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2063,7 +2063,7 @@ create_reconnect_durable_buf(struct cifs_fid *fid)
20632063
static void
20642064
parse_query_id_ctxt(struct create_context *cc, struct smb2_file_all_info *buf)
20652065
{
2066-
struct create_on_disk_id *pdisk_id = (struct create_on_disk_id *)cc;
2066+
struct create_disk_id_rsp *pdisk_id = (struct create_disk_id_rsp *)cc;
20672067

20682068
cifs_dbg(FYI, "parse query id context 0x%llx 0x%llx\n",
20692069
pdisk_id->DiskFileId, pdisk_id->VolumeId);

fs/cifs/smb2pdu.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -170,15 +170,6 @@ struct durable_reconnect_context_v2 {
170170
__le32 Flags; /* see above DHANDLE_FLAG_PERSISTENT */
171171
} __packed;
172172

173-
/* See MS-SMB2 2.2.14.2.9 */
174-
struct create_on_disk_id {
175-
struct create_context ccontext;
176-
__u8 Name[8];
177-
__le64 DiskFileId;
178-
__le64 VolumeId;
179-
__u32 Reserved[4];
180-
} __packed;
181-
182173
/* See MS-SMB2 2.2.14.2.12 */
183174
struct durable_reconnect_context_v2_rsp {
184175
__le32 Timeout;

fs/ksmbd/smb2pdu.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,6 @@ struct create_mxac_rsp {
144144
__le32 MaximalAccess;
145145
} __packed;
146146

147-
struct create_disk_id_rsp {
148-
struct create_context ccontext;
149-
__u8 Name[8];
150-
__le64 DiskFileId;
151-
__le64 VolumeId;
152-
__u8 Reserved[16];
153-
} __packed;
154-
155147
/* equivalent of the contents of SMB3.1.1 POSIX open context response */
156148
struct create_posix_rsp {
157149
struct create_context ccontext;

fs/smbfs_common/smb2pdu.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,13 +1181,15 @@ struct create_posix {
11811181

11821182
#define SMB2_LEASE_KEY_SIZE 16
11831183

1184+
/* See MS-SMB2 2.2.13.2.8 */
11841185
struct lease_context {
11851186
__u8 LeaseKey[SMB2_LEASE_KEY_SIZE];
11861187
__le32 LeaseState;
11871188
__le32 LeaseFlags;
11881189
__le64 LeaseDuration;
11891190
} __packed;
11901191

1192+
/* See MS-SMB2 2.2.13.2.10 */
11911193
struct lease_context_v2 {
11921194
__u8 LeaseKey[SMB2_LEASE_KEY_SIZE];
11931195
__le32 LeaseState;
@@ -1211,6 +1213,15 @@ struct create_lease_v2 {
12111213
__u8 Pad[4];
12121214
} __packed;
12131215

1216+
/* See MS-SMB2 2.2.14.2.9 */
1217+
struct create_disk_id_rsp {
1218+
struct create_context ccontext;
1219+
__u8 Name[8];
1220+
__le64 DiskFileId;
1221+
__le64 VolumeId;
1222+
__u8 Reserved[16];
1223+
} __packed;
1224+
12141225
/* See MS-SMB2 2.2.31 and 2.2.32 */
12151226
struct smb2_ioctl_req {
12161227
struct smb2_hdr hdr;

0 commit comments

Comments
 (0)