]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
CIFS: Propagate min offload along with other parameters from primary to secondary...
authorAman <aman1@microsoft.com>
Thu, 6 Mar 2025 17:46:43 +0000 (17:46 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 20 Apr 2025 08:15:51 +0000 (10:15 +0200)
commit 1821e90be08e7d4a54cd167dd818d80d06e064e9 upstream.

In a multichannel setup, it was observed that a few fields were not being
copied over to the secondary channels, which impacted performance in cases
where these options were relevant but not properly synchronized. To address
this, this patch introduces copying the following parameters from the
primary channel to the secondary channels:

- min_offload
- compression.requested
- dfs_conn
- ignore_signature
- leaf_fullpath
- noblockcnt
- retrans
- sign

By copying these parameters, we ensure consistency across channels and
prevent performance degradation due to missing or outdated settings.

Cc: stable@vger.kernel.org
Signed-off-by: Aman <aman1@microsoft.com>
Reviewed-by: Paulo Alcantara (Red Hat) <pc@manguebit.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/smb/client/connect.c
fs/smb/client/sess.c

index 18443d879c2d31178039450b36670e4febba7677..3aaf5cdce1b72079978a5dbd4ae380c553739331 100644 (file)
@@ -1722,6 +1722,7 @@ cifs_get_tcp_session(struct smb3_fs_context *ctx,
        /* Grab netns reference for this server. */
        cifs_set_net_ns(tcp_ses, get_net(current->nsproxy->net_ns));
 
+       tcp_ses->sign = ctx->sign;
        tcp_ses->conn_id = atomic_inc_return(&tcpSesNextId);
        tcp_ses->noblockcnt = ctx->rootfs;
        tcp_ses->noblocksnd = ctx->noblocksnd || ctx->rootfs;
index 95e14977baeab06e63ed0824da31ecab9504c872..2426fa7405173cb8de0a29774ef9ad8f5103fd12 100644 (file)
@@ -550,6 +550,13 @@ cifs_ses_add_channel(struct cifs_ses *ses,
        ctx->sockopt_tcp_nodelay = ses->server->tcp_nodelay;
        ctx->echo_interval = ses->server->echo_interval / HZ;
        ctx->max_credits = ses->server->max_credits;
+       ctx->min_offload = ses->server->min_offload;
+       ctx->compress = ses->server->compression.requested;
+       ctx->dfs_conn = ses->server->dfs_conn;
+       ctx->ignore_signature = ses->server->ignore_signature;
+       ctx->leaf_fullpath = ses->server->leaf_fullpath;
+       ctx->rootfs = ses->server->noblockcnt;
+       ctx->retrans = ses->server->retrans;
 
        /*
         * This will be used for encoding/decoding user/domain/pw