@@ -629,10 +629,10 @@ static void __smb2_oplock_break_noti(struct work_struct *wk)
629629 return ;
630630 }
631631
632- rsp_hdr = work -> response_buf ;
632+ rsp_hdr = smb2_get_msg ( work -> response_buf ) ;
633633 memset (rsp_hdr , 0 , sizeof (struct smb2_hdr ) + 2 );
634- rsp_hdr -> smb2_buf_length =
635- cpu_to_be32 (smb2_hdr_size_no_buflen ( conn -> vals ) );
634+ * ( __be32 * ) work -> response_buf =
635+ cpu_to_be32 (conn -> vals -> header_size );
636636 rsp_hdr -> ProtocolId = SMB2_PROTO_NUMBER ;
637637 rsp_hdr -> StructureSize = SMB2_HEADER_STRUCTURE_SIZE ;
638638 rsp_hdr -> CreditRequest = cpu_to_le16 (0 );
@@ -645,7 +645,7 @@ static void __smb2_oplock_break_noti(struct work_struct *wk)
645645 rsp_hdr -> SessionId = 0 ;
646646 memset (rsp_hdr -> Signature , 0 , 16 );
647647
648- rsp = work -> response_buf ;
648+ rsp = smb2_get_msg ( work -> response_buf ) ;
649649
650650 rsp -> StructureSize = cpu_to_le16 (24 );
651651 if (!br_info -> open_trunc &&
@@ -659,7 +659,7 @@ static void __smb2_oplock_break_noti(struct work_struct *wk)
659659 rsp -> PersistentFid = cpu_to_le64 (fp -> persistent_id );
660660 rsp -> VolatileFid = cpu_to_le64 (fp -> volatile_id );
661661
662- inc_rfc1001_len (rsp , 24 );
662+ inc_rfc1001_len (work -> response_buf , 24 );
663663
664664 ksmbd_debug (OPLOCK ,
665665 "sending oplock break v_id %llu p_id = %llu lock level = %d\n" ,
@@ -736,10 +736,10 @@ static void __smb2_lease_break_noti(struct work_struct *wk)
736736 return ;
737737 }
738738
739- rsp_hdr = work -> response_buf ;
739+ rsp_hdr = smb2_get_msg ( work -> response_buf ) ;
740740 memset (rsp_hdr , 0 , sizeof (struct smb2_hdr ) + 2 );
741- rsp_hdr -> smb2_buf_length =
742- cpu_to_be32 (smb2_hdr_size_no_buflen ( conn -> vals ) );
741+ * ( __be32 * ) work -> response_buf =
742+ cpu_to_be32 (conn -> vals -> header_size );
743743 rsp_hdr -> ProtocolId = SMB2_PROTO_NUMBER ;
744744 rsp_hdr -> StructureSize = SMB2_HEADER_STRUCTURE_SIZE ;
745745 rsp_hdr -> CreditRequest = cpu_to_le16 (0 );
@@ -752,7 +752,7 @@ static void __smb2_lease_break_noti(struct work_struct *wk)
752752 rsp_hdr -> SessionId = 0 ;
753753 memset (rsp_hdr -> Signature , 0 , 16 );
754754
755- rsp = work -> response_buf ;
755+ rsp = smb2_get_msg ( work -> response_buf ) ;
756756 rsp -> StructureSize = cpu_to_le16 (44 );
757757 rsp -> Epoch = br_info -> epoch ;
758758 rsp -> Flags = 0 ;
@@ -768,7 +768,7 @@ static void __smb2_lease_break_noti(struct work_struct *wk)
768768 rsp -> AccessMaskHint = 0 ;
769769 rsp -> ShareMaskHint = 0 ;
770770
771- inc_rfc1001_len (rsp , 44 );
771+ inc_rfc1001_len (work -> response_buf , 44 );
772772
773773 ksmbd_conn_write (work );
774774 ksmbd_free_work_struct (work );
@@ -1398,7 +1398,7 @@ struct lease_ctx_info *parse_lease_state(void *open_req)
13981398 if (!lreq )
13991399 return NULL ;
14001400
1401- data_offset = (char * )req + 4 + le32_to_cpu (req -> CreateContextsOffset );
1401+ data_offset = (char * )req + le32_to_cpu (req -> CreateContextsOffset );
14021402 cc = (struct create_context * )data_offset ;
14031403 do {
14041404 cc = (struct create_context * )((char * )cc + next );
@@ -1462,7 +1462,7 @@ struct create_context *smb2_find_context_vals(void *open_req, const char *tag)
14621462 * CreateContextsOffset and CreateContextsLength are guaranteed to
14631463 * be valid because of ksmbd_smb2_check_message().
14641464 */
1465- cc = (struct create_context * )((char * )req + 4 +
1465+ cc = (struct create_context * )((char * )req +
14661466 le32_to_cpu (req -> CreateContextsOffset ));
14671467 remain_len = le32_to_cpu (req -> CreateContextsLength );
14681468 do {
0 commit comments