@@ -1260,7 +1260,7 @@ SMB2_sess_alloc_buffer(struct SMB2_sess_data *sess_data)
1260
1260
* if reconnect, we need to send previous sess id
1261
1261
* otherwise it is 0
1262
1262
*/
1263
- req -> PreviousSessionId = sess_data -> previous_session ;
1263
+ req -> PreviousSessionId = cpu_to_le64 ( sess_data -> previous_session ) ;
1264
1264
req -> Flags = 0 ; /* MBZ */
1265
1265
}
1266
1266
@@ -3234,8 +3234,8 @@ SMB2_close_init(struct cifs_tcon *tcon, struct TCP_Server_Info *server,
3234
3234
if (rc )
3235
3235
return rc ;
3236
3236
3237
- req -> PersistentFileId = persistent_fid ;
3238
- req -> VolatileFileId = volatile_fid ;
3237
+ req -> PersistentFileId = cpu_to_le64 ( persistent_fid ) ;
3238
+ req -> VolatileFileId = cpu_to_le64 ( volatile_fid ) ;
3239
3239
if (query_attrs )
3240
3240
req -> Flags = SMB2_CLOSE_FLAG_POSTQUERY_ATTRIB ;
3241
3241
else
@@ -3598,8 +3598,8 @@ SMB2_notify_init(const unsigned int xid, struct smb_rqst *rqst,
3598
3598
if (rc )
3599
3599
return rc ;
3600
3600
3601
- req -> PersistentFileId = persistent_fid ;
3602
- req -> VolatileFileId = volatile_fid ;
3601
+ req -> PersistentFileId = cpu_to_le64 ( persistent_fid ) ;
3602
+ req -> VolatileFileId = cpu_to_le64 ( volatile_fid ) ;
3603
3603
/* See note 354 of MS-SMB2, 64K max */
3604
3604
req -> OutputBufferLength =
3605
3605
cpu_to_le32 (SMB2_MAX_BUFFER_SIZE - MAX_SMB2_HDR_SIZE );
@@ -3821,8 +3821,8 @@ SMB2_flush_init(const unsigned int xid, struct smb_rqst *rqst,
3821
3821
if (rc )
3822
3822
return rc ;
3823
3823
3824
- req -> PersistentFileId = persistent_fid ;
3825
- req -> VolatileFileId = volatile_fid ;
3824
+ req -> PersistentFileId = cpu_to_le64 ( persistent_fid ) ;
3825
+ req -> VolatileFileId = cpu_to_le64 ( volatile_fid ) ;
3826
3826
3827
3827
iov [0 ].iov_base = (char * )req ;
3828
3828
iov [0 ].iov_len = total_len ;
@@ -3888,7 +3888,7 @@ smb2_new_read_req(void **buf, unsigned int *total_len,
3888
3888
unsigned int remaining_bytes , int request_type )
3889
3889
{
3890
3890
int rc = - EACCES ;
3891
- struct smb2_read_plain_req * req = NULL ;
3891
+ struct smb2_read_req * req = NULL ;
3892
3892
struct smb2_hdr * shdr ;
3893
3893
struct TCP_Server_Info * server = io_parms -> server ;
3894
3894
@@ -3903,8 +3903,8 @@ smb2_new_read_req(void **buf, unsigned int *total_len,
3903
3903
shdr = & req -> hdr ;
3904
3904
shdr -> Id .SyncId .ProcessId = cpu_to_le32 (io_parms -> pid );
3905
3905
3906
- req -> PersistentFileId = io_parms -> persistent_fid ;
3907
- req -> VolatileFileId = io_parms -> volatile_fid ;
3906
+ req -> PersistentFileId = cpu_to_le64 ( io_parms -> persistent_fid ) ;
3907
+ req -> VolatileFileId = cpu_to_le64 ( io_parms -> volatile_fid ) ;
3908
3908
req -> ReadChannelInfoOffset = 0 ; /* reserved */
3909
3909
req -> ReadChannelInfoLength = 0 ; /* reserved */
3910
3910
req -> Channel = 0 ; /* reserved */
@@ -3938,7 +3938,7 @@ smb2_new_read_req(void **buf, unsigned int *total_len,
3938
3938
if (need_invalidate )
3939
3939
req -> Channel = SMB2_CHANNEL_RDMA_V1 ;
3940
3940
req -> ReadChannelInfoOffset =
3941
- cpu_to_le16 (offsetof(struct smb2_read_plain_req , Buffer ));
3941
+ cpu_to_le16 (offsetof(struct smb2_read_req , Buffer ));
3942
3942
req -> ReadChannelInfoLength =
3943
3943
cpu_to_le16 (sizeof (struct smbd_buffer_descriptor_v1 ));
3944
3944
v1 = (struct smbd_buffer_descriptor_v1 * ) & req -> Buffer [0 ];
@@ -3964,8 +3964,8 @@ smb2_new_read_req(void **buf, unsigned int *total_len,
3964
3964
*/
3965
3965
shdr -> SessionId = cpu_to_le64 (0xFFFFFFFFFFFFFFFF );
3966
3966
shdr -> Id .SyncId .TreeId = cpu_to_le32 (0xFFFFFFFF );
3967
- req -> PersistentFileId = 0xFFFFFFFFFFFFFFFF ;
3968
- req -> VolatileFileId = 0xFFFFFFFFFFFFFFFF ;
3967
+ req -> PersistentFileId = cpu_to_le64 ( 0xFFFFFFFFFFFFFFFF ) ;
3968
+ req -> VolatileFileId = cpu_to_le64 ( 0xFFFFFFFFFFFFFFFF ) ;
3969
3969
}
3970
3970
}
3971
3971
if (remaining_bytes > io_parms -> length )
@@ -4142,7 +4142,7 @@ SMB2_read(const unsigned int xid, struct cifs_io_parms *io_parms,
4142
4142
{
4143
4143
struct smb_rqst rqst ;
4144
4144
int resp_buftype , rc ;
4145
- struct smb2_read_plain_req * req = NULL ;
4145
+ struct smb2_read_req * req = NULL ;
4146
4146
struct smb2_read_rsp * rsp = NULL ;
4147
4147
struct kvec iov [1 ];
4148
4148
struct kvec rsp_iov ;
@@ -4176,19 +4176,22 @@ SMB2_read(const unsigned int xid, struct cifs_io_parms *io_parms,
4176
4176
if (rc != - ENODATA ) {
4177
4177
cifs_stats_fail_inc (io_parms -> tcon , SMB2_READ_HE );
4178
4178
cifs_dbg (VFS , "Send error in read = %d\n" , rc );
4179
- trace_smb3_read_err (xid , req -> PersistentFileId ,
4179
+ trace_smb3_read_err (xid ,
4180
+ le64_to_cpu (req -> PersistentFileId ),
4180
4181
io_parms -> tcon -> tid , ses -> Suid ,
4181
4182
io_parms -> offset , io_parms -> length ,
4182
4183
rc );
4183
4184
} else
4184
- trace_smb3_read_done (xid , req -> PersistentFileId ,
4185
- io_parms -> tcon -> tid , ses -> Suid ,
4186
- io_parms -> offset , 0 );
4185
+ trace_smb3_read_done (xid ,
4186
+ le64_to_cpu (req -> PersistentFileId ),
4187
+ io_parms -> tcon -> tid , ses -> Suid ,
4188
+ io_parms -> offset , 0 );
4187
4189
free_rsp_buf (resp_buftype , rsp_iov .iov_base );
4188
4190
cifs_small_buf_release (req );
4189
4191
return rc == - ENODATA ? 0 : rc ;
4190
4192
} else
4191
- trace_smb3_read_done (xid , req -> PersistentFileId ,
4193
+ trace_smb3_read_done (xid ,
4194
+ le64_to_cpu (req -> PersistentFileId ),
4192
4195
io_parms -> tcon -> tid , ses -> Suid ,
4193
4196
io_parms -> offset , io_parms -> length );
4194
4197
@@ -4330,8 +4333,8 @@ smb2_async_writev(struct cifs_writedata *wdata,
4330
4333
shdr = (struct smb2_hdr * )req ;
4331
4334
shdr -> Id .SyncId .ProcessId = cpu_to_le32 (wdata -> cfile -> pid );
4332
4335
4333
- req -> PersistentFileId = wdata -> cfile -> fid .persistent_fid ;
4334
- req -> VolatileFileId = wdata -> cfile -> fid .volatile_fid ;
4336
+ req -> PersistentFileId = cpu_to_le64 ( wdata -> cfile -> fid .persistent_fid ) ;
4337
+ req -> VolatileFileId = cpu_to_le64 ( wdata -> cfile -> fid .volatile_fid ) ;
4335
4338
req -> WriteChannelInfoOffset = 0 ;
4336
4339
req -> WriteChannelInfoLength = 0 ;
4337
4340
req -> Channel = 0 ;
@@ -4428,7 +4431,8 @@ smb2_async_writev(struct cifs_writedata *wdata,
4428
4431
wdata , flags , & wdata -> credits );
4429
4432
4430
4433
if (rc ) {
4431
- trace_smb3_write_err (0 /* no xid */ , req -> PersistentFileId ,
4434
+ trace_smb3_write_err (0 /* no xid */ ,
4435
+ le64_to_cpu (req -> PersistentFileId ),
4432
4436
tcon -> tid , tcon -> ses -> Suid , wdata -> offset ,
4433
4437
wdata -> bytes , rc );
4434
4438
kref_put (& wdata -> refcount , release );
@@ -4481,8 +4485,8 @@ SMB2_write(const unsigned int xid, struct cifs_io_parms *io_parms,
4481
4485
4482
4486
req -> hdr .Id .SyncId .ProcessId = cpu_to_le32 (io_parms -> pid );
4483
4487
4484
- req -> PersistentFileId = io_parms -> persistent_fid ;
4485
- req -> VolatileFileId = io_parms -> volatile_fid ;
4488
+ req -> PersistentFileId = cpu_to_le64 ( io_parms -> persistent_fid ) ;
4489
+ req -> VolatileFileId = cpu_to_le64 ( io_parms -> volatile_fid ) ;
4486
4490
req -> WriteChannelInfoOffset = 0 ;
4487
4491
req -> WriteChannelInfoLength = 0 ;
4488
4492
req -> Channel = 0 ;
@@ -4510,18 +4514,20 @@ SMB2_write(const unsigned int xid, struct cifs_io_parms *io_parms,
4510
4514
rsp = (struct smb2_write_rsp * )rsp_iov .iov_base ;
4511
4515
4512
4516
if (rc ) {
4513
- trace_smb3_write_err (xid , req -> PersistentFileId ,
4517
+ trace_smb3_write_err (xid ,
4518
+ le64_to_cpu (req -> PersistentFileId ),
4514
4519
io_parms -> tcon -> tid ,
4515
4520
io_parms -> tcon -> ses -> Suid ,
4516
4521
io_parms -> offset , io_parms -> length , rc );
4517
4522
cifs_stats_fail_inc (io_parms -> tcon , SMB2_WRITE_HE );
4518
4523
cifs_dbg (VFS , "Send error in write = %d\n" , rc );
4519
4524
} else {
4520
4525
* nbytes = le32_to_cpu (rsp -> DataLength );
4521
- trace_smb3_write_done (xid , req -> PersistentFileId ,
4522
- io_parms -> tcon -> tid ,
4523
- io_parms -> tcon -> ses -> Suid ,
4524
- io_parms -> offset , * nbytes );
4526
+ trace_smb3_write_done (xid ,
4527
+ le64_to_cpu (req -> PersistentFileId ),
4528
+ io_parms -> tcon -> tid ,
4529
+ io_parms -> tcon -> ses -> Suid ,
4530
+ io_parms -> offset , * nbytes );
4525
4531
}
4526
4532
4527
4533
cifs_small_buf_release (req );
0 commit comments