]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ksmbd: avoid duplicate negotiate ctx offset increments
authorDavid Disseldorp <ddiss@suse.de>
Sun, 31 Dec 2023 07:12:34 +0000 (16:12 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Jan 2024 14:18:29 +0000 (15:18 +0100)
commit49d9f6ad1ee064c52662538fc48b2ada33ae3fd2
treee571a2aa4e43d029a9ec8ae9c9b11ee10ba36b67
parent2182d96ec0b790a0cf981889bf7e9e615102d4ee
ksmbd: avoid duplicate negotiate ctx offset increments

[ Upstream commit a12a07a85aff72e19520328f78b1c64d2281a1ec ]

Both pneg_ctxt and ctxt_size change in unison, with each adding the
length of the previously added context, rounded up to an eight byte
boundary.
Drop pneg_ctxt increments and instead use the ctxt_size offset when
passing output pointers to per-context helper functions. This slightly
simplifies offset tracking and shaves off a few text bytes.
Before (x86-64 gcc 7.5):
   text    data     bss     dec     hex filename
 213234    8677     672  222583   36577 ksmbd.ko

After:
   text    data     bss     dec     hex filename
 213218    8677     672  222567   36567 ksmbd.ko

Signed-off-by: David Disseldorp <ddiss@suse.de>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/smb/server/smb2pdu.c