Re: [PATCH v6 1/9] cifs: Remove the RFC1002 header from smb_hdr
From: Namjae Jeon
Date: Thu Dec 18 2025 - 07:19:05 EST
On Tue, Dec 2, 2025 at 7:59 AM David Howells <dhowells@xxxxxxxxxx> wrote:
>
> Remove the RFC1002 header from struct smb_hdr as used for SMB-1.0. This
> simplifies the SMB-1.0 code by simplifying a lot of places that have to add
> or subtract 4 to work around the fact that the RFC1002 header isn't really
> part of the message and the base for various offsets within the message is
> from the base of the smb_hdr, not the RFC1002 header.
>
> Further, clean up a bunch of places that require an extra kvec struct
> specifically pointing to the RFC1002 header, such that kvec[0].iov_base
> must be exactly 4 bytes before kvec[1].iov_base.
>
> This allows the header preamble size stuff to be removed too.
>
> The size of the request and response message are then handed around either
> directly or by summing the size of all the iov_len members in the kvec
> array for which we have a count.
>
> Also, this simplifies and cleans up the common transmission and receive
> paths for SMB1 and SMB2/3 as there no longer needs to be special handling
> casing for SMB1 messages as the RFC1002 header is now generated on the fly
> for SMB1 as it is for SMB2/3.
>
> Signed-off-by: David Howells <dhowells@xxxxxxxxxx>
> Reviewed-by: Tom Talpey <tom@xxxxxxxxxx>
> cc: Steve French <sfrench@xxxxxxxxx>
> cc: Paulo Alcantara <pc@xxxxxxxxxxxxx>
> cc: Shyam Prasad N <sprasad@xxxxxxxxxxxxx>
> cc: linux-cifs@xxxxxxxxxxxxxxx
> cc: netfs@xxxxxxxxxxxxxxx
> cc: linux-fsdevel@xxxxxxxxxxxxxxx
> ---
> fs/smb/client/cifs_debug.c | 10 +-
> fs/smb/client/cifs_debug.h | 6 +-
> fs/smb/client/cifsencrypt.c | 36 +-
> fs/smb/client/cifsglob.h | 23 +-
> fs/smb/client/cifspdu.h | 2 +-
> fs/smb/client/cifsproto.h | 51 ++-
> fs/smb/client/cifssmb.c | 735 +++++++++++++++++++---------------
> fs/smb/client/cifstransport.c | 208 ++++------
> fs/smb/client/connect.c | 36 +-
> fs/smb/client/misc.c | 34 +-
> fs/smb/client/sess.c | 8 +-
> fs/smb/client/smb1ops.c | 21 +-
> fs/smb/client/smb2misc.c | 3 +-
> fs/smb/client/smb2ops.c | 11 +-
> fs/smb/client/smb2proto.h | 2 +-
> fs/smb/client/transport.c | 80 ++--
> fs/smb/common/smb2pdu.h | 3 -
> fs/smb/common/smbglob.h | 1 -
> 18 files changed, 645 insertions(+), 625 deletions(-)
Why did you only change smb client after changing smb_hdr structure in
smb/common? smb server also uses smb_hdr structure to handle smb1
negotiate request. Also, Why didn't you cc me on the patch that
updates smb/common?