1 From 1821e90be08e7d4a54cd167dd818d80d06e064e9 Mon Sep 17 00:00:00 2001
2 From: Aman <aman1@microsoft.com>
3 Date: Thu, 6 Mar 2025 17:46:43 +0000
4 Subject: CIFS: Propagate min offload along with other parameters from primary to secondary channels.
6 From: Aman <aman1@microsoft.com>
8 commit 1821e90be08e7d4a54cd167dd818d80d06e064e9 upstream.
10 In a multichannel setup, it was observed that a few fields were not being
11 copied over to the secondary channels, which impacted performance in cases
12 where these options were relevant but not properly synchronized. To address
13 this, this patch introduces copying the following parameters from the
14 primary channel to the secondary channels:
17 - compression.requested
25 By copying these parameters, we ensure consistency across channels and
26 prevent performance degradation due to missing or outdated settings.
28 Cc: stable@vger.kernel.org
29 Signed-off-by: Aman <aman1@microsoft.com>
30 Reviewed-by: Paulo Alcantara (Red Hat) <pc@manguebit.com>
31 Signed-off-by: Steve French <stfrench@microsoft.com>
32 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
34 fs/smb/client/connect.c | 1 +
35 fs/smb/client/sess.c | 7 +++++++
36 2 files changed, 8 insertions(+)
38 --- a/fs/smb/client/connect.c
39 +++ b/fs/smb/client/connect.c
40 @@ -1677,6 +1677,7 @@ cifs_get_tcp_session(struct smb3_fs_cont
41 /* Grab netns reference for this server. */
42 cifs_set_net_ns(tcp_ses, get_net(current->nsproxy->net_ns));
44 + tcp_ses->sign = ctx->sign;
45 tcp_ses->conn_id = atomic_inc_return(&tcpSesNextId);
46 tcp_ses->noblockcnt = ctx->rootfs;
47 tcp_ses->noblocksnd = ctx->noblocksnd || ctx->rootfs;
48 --- a/fs/smb/client/sess.c
49 +++ b/fs/smb/client/sess.c
50 @@ -522,6 +522,13 @@ cifs_ses_add_channel(struct cifs_ses *se
51 ctx->sockopt_tcp_nodelay = ses->server->tcp_nodelay;
52 ctx->echo_interval = ses->server->echo_interval / HZ;
53 ctx->max_credits = ses->server->max_credits;
54 + ctx->min_offload = ses->server->min_offload;
55 + ctx->compress = ses->server->compression.requested;
56 + ctx->dfs_conn = ses->server->dfs_conn;
57 + ctx->ignore_signature = ses->server->ignore_signature;
58 + ctx->leaf_fullpath = ses->server->leaf_fullpath;
59 + ctx->rootfs = ses->server->noblockcnt;
60 + ctx->retrans = ses->server->retrans;
63 * This will be used for encoding/decoding user/domain/pw