@@ -1260,7 +1260,7 @@ SMB2_sess_alloc_buffer(struct SMB2_sess_data *sess_data)
12601260 * if reconnect, we need to send previous sess id
12611261 * otherwise it is 0
12621262 */
1263- req -> PreviousSessionId = sess_data -> previous_session ;
1263+ req -> PreviousSessionId = cpu_to_le64 ( sess_data -> previous_session ) ;
12641264 req -> Flags = 0 ; /* MBZ */
12651265 }
12661266
@@ -3234,8 +3234,8 @@ SMB2_close_init(struct cifs_tcon *tcon, struct TCP_Server_Info *server,
32343234 if (rc )
32353235 return rc ;
32363236
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 ) ;
32393239 if (query_attrs )
32403240 req -> Flags = SMB2_CLOSE_FLAG_POSTQUERY_ATTRIB ;
32413241 else
@@ -3598,8 +3598,8 @@ SMB2_notify_init(const unsigned int xid, struct smb_rqst *rqst,
35983598 if (rc )
35993599 return rc ;
36003600
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 ) ;
36033603 /* See note 354 of MS-SMB2, 64K max */
36043604 req -> OutputBufferLength =
36053605 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,
38213821 if (rc )
38223822 return rc ;
38233823
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 ) ;
38263826
38273827 iov [0 ].iov_base = (char * )req ;
38283828 iov [0 ].iov_len = total_len ;
@@ -3888,7 +3888,7 @@ smb2_new_read_req(void **buf, unsigned int *total_len,
38883888 unsigned int remaining_bytes , int request_type )
38893889{
38903890 int rc = - EACCES ;
3891- struct smb2_read_plain_req * req = NULL ;
3891+ struct smb2_read_req * req = NULL ;
38923892 struct smb2_hdr * shdr ;
38933893 struct TCP_Server_Info * server = io_parms -> server ;
38943894
@@ -3903,8 +3903,8 @@ smb2_new_read_req(void **buf, unsigned int *total_len,
39033903 shdr = & req -> hdr ;
39043904 shdr -> Id .SyncId .ProcessId = cpu_to_le32 (io_parms -> pid );
39053905
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 ) ;
39083908 req -> ReadChannelInfoOffset = 0 ; /* reserved */
39093909 req -> ReadChannelInfoLength = 0 ; /* reserved */
39103910 req -> Channel = 0 ; /* reserved */
@@ -3938,7 +3938,7 @@ smb2_new_read_req(void **buf, unsigned int *total_len,
39383938 if (need_invalidate )
39393939 req -> Channel = SMB2_CHANNEL_RDMA_V1 ;
39403940 req -> ReadChannelInfoOffset =
3941- cpu_to_le16 (offsetof(struct smb2_read_plain_req , Buffer ));
3941+ cpu_to_le16 (offsetof(struct smb2_read_req , Buffer ));
39423942 req -> ReadChannelInfoLength =
39433943 cpu_to_le16 (sizeof (struct smbd_buffer_descriptor_v1 ));
39443944 v1 = (struct smbd_buffer_descriptor_v1 * ) & req -> Buffer [0 ];
@@ -3964,8 +3964,8 @@ smb2_new_read_req(void **buf, unsigned int *total_len,
39643964 */
39653965 shdr -> SessionId = cpu_to_le64 (0xFFFFFFFFFFFFFFFF );
39663966 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 ) ;
39693969 }
39703970 }
39713971 if (remaining_bytes > io_parms -> length )
@@ -4142,7 +4142,7 @@ SMB2_read(const unsigned int xid, struct cifs_io_parms *io_parms,
41424142{
41434143 struct smb_rqst rqst ;
41444144 int resp_buftype , rc ;
4145- struct smb2_read_plain_req * req = NULL ;
4145+ struct smb2_read_req * req = NULL ;
41464146 struct smb2_read_rsp * rsp = NULL ;
41474147 struct kvec iov [1 ];
41484148 struct kvec rsp_iov ;
@@ -4176,19 +4176,22 @@ SMB2_read(const unsigned int xid, struct cifs_io_parms *io_parms,
41764176 if (rc != - ENODATA ) {
41774177 cifs_stats_fail_inc (io_parms -> tcon , SMB2_READ_HE );
41784178 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 ),
41804181 io_parms -> tcon -> tid , ses -> Suid ,
41814182 io_parms -> offset , io_parms -> length ,
41824183 rc );
41834184 } 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 );
41874189 free_rsp_buf (resp_buftype , rsp_iov .iov_base );
41884190 cifs_small_buf_release (req );
41894191 return rc == - ENODATA ? 0 : rc ;
41904192 } else
4191- trace_smb3_read_done (xid , req -> PersistentFileId ,
4193+ trace_smb3_read_done (xid ,
4194+ le64_to_cpu (req -> PersistentFileId ),
41924195 io_parms -> tcon -> tid , ses -> Suid ,
41934196 io_parms -> offset , io_parms -> length );
41944197
@@ -4330,8 +4333,8 @@ smb2_async_writev(struct cifs_writedata *wdata,
43304333 shdr = (struct smb2_hdr * )req ;
43314334 shdr -> Id .SyncId .ProcessId = cpu_to_le32 (wdata -> cfile -> pid );
43324335
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 ) ;
43354338 req -> WriteChannelInfoOffset = 0 ;
43364339 req -> WriteChannelInfoLength = 0 ;
43374340 req -> Channel = 0 ;
@@ -4428,7 +4431,8 @@ smb2_async_writev(struct cifs_writedata *wdata,
44284431 wdata , flags , & wdata -> credits );
44294432
44304433 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 ),
44324436 tcon -> tid , tcon -> ses -> Suid , wdata -> offset ,
44334437 wdata -> bytes , rc );
44344438 kref_put (& wdata -> refcount , release );
@@ -4481,8 +4485,8 @@ SMB2_write(const unsigned int xid, struct cifs_io_parms *io_parms,
44814485
44824486 req -> hdr .Id .SyncId .ProcessId = cpu_to_le32 (io_parms -> pid );
44834487
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 ) ;
44864490 req -> WriteChannelInfoOffset = 0 ;
44874491 req -> WriteChannelInfoLength = 0 ;
44884492 req -> Channel = 0 ;
@@ -4510,18 +4514,20 @@ SMB2_write(const unsigned int xid, struct cifs_io_parms *io_parms,
45104514 rsp = (struct smb2_write_rsp * )rsp_iov .iov_base ;
45114515
45124516 if (rc ) {
4513- trace_smb3_write_err (xid , req -> PersistentFileId ,
4517+ trace_smb3_write_err (xid ,
4518+ le64_to_cpu (req -> PersistentFileId ),
45144519 io_parms -> tcon -> tid ,
45154520 io_parms -> tcon -> ses -> Suid ,
45164521 io_parms -> offset , io_parms -> length , rc );
45174522 cifs_stats_fail_inc (io_parms -> tcon , SMB2_WRITE_HE );
45184523 cifs_dbg (VFS , "Send error in write = %d\n" , rc );
45194524 } else {
45204525 * 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 );
45254531 }
45264532
45274533 cifs_small_buf_release (req );
0 commit comments