From: Paulo Alcantara <pc@manguebit.com>
To: aman1cifs@gmail.com, linux-cifs@vger.kernel.org,
sfrench@samba.org, sprasad@microsoft.com, tom@talpey.com,
ronniesahlberg@gmail.com, bharathsm@microsoft.com
Cc: Aman <aman1@microsoft.com>
Subject: Re: [PATCH 1/2] CIFS: Propagate min offload along with other parameters from primary to secondary channels.
Date: Thu, 27 Feb 2025 13:33:29 -0300 [thread overview]
Message-ID: <880cc89622306730dda9ff471e9bb896@manguebit.com> (raw)
In-Reply-To: <20250214124306.498808-1-aman1cifs@gmail.com>
aman1cifs@gmail.com writes:
> From: Aman <aman1@microsoft.com>
>
> 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.
>
> Signed-off-by: Aman <aman1@microsoft.com>
> ---
> fs/smb/client/connect.c | 1 +
> fs/smb/client/sess.c | 10 ++++++++++
> 2 files changed, 11 insertions(+)
>
> diff --git a/fs/smb/client/connect.c b/fs/smb/client/connect.c
> index eaa6be445..eb82458eb 100644
> --- a/fs/smb/client/connect.c
> +++ b/fs/smb/client/connect.c
> @@ -1721,6 +1721,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;
> diff --git a/fs/smb/client/sess.c b/fs/smb/client/sess.c
> index 91d4d409c..fdbd32a13 100644
> --- a/fs/smb/client/sess.c
> +++ b/fs/smb/client/sess.c
> @@ -522,6 +522,16 @@ 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;
> +
> + if (ses->server->leaf_fullpath)
> + ctx->leaf_fullpath = kstrdup(ses->server->leaf_fullpath, GFP_KERNEL);
You're missing NULL check in case kstrdup() fails and also leaking
@ctx->leaf_fullpath.
You don't need to kstrdup() it as cifs_get_tcp_session() will already do it.
Simply assign @ctx->leaf_fullpath to @ses->server->leaf_fullpath before
calling cifs_get_tcp_session().
next prev parent reply other threads:[~2025-02-27 16:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-14 12:43 [PATCH 1/2] CIFS: Propagate min offload along with other parameters from primary to secondary channels aman1cifs
2025-02-14 12:43 ` [PATCH 2/2] CIFS: adds min_offload and other params to cifs_debug aman1cifs
2025-02-14 17:55 ` Steve French
2025-02-27 16:33 ` Paulo Alcantara [this message]
2025-03-06 17:46 ` [PATCH 1/2] CIFS: Propagate min offload along with other parameters from primary to secondary channels aman1cifs
2025-03-11 3:25 ` Steve French
2025-03-11 11:21 ` aman
[not found] <Z66BwJnHAI8zDOzP@linuxbox.oloxx3b4wsrernbskgt3tooxxe.gx.internal.cloudapp.net>
2025-03-28 6:13 ` aman1cifs
2025-03-28 7:19 ` Shyam Prasad N
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=880cc89622306730dda9ff471e9bb896@manguebit.com \
--to=pc@manguebit.com \
--cc=aman1@microsoft.com \
--cc=aman1cifs@gmail.com \
--cc=bharathsm@microsoft.com \
--cc=linux-cifs@vger.kernel.org \
--cc=ronniesahlberg@gmail.com \
--cc=sfrench@samba.org \
--cc=sprasad@microsoft.com \
--cc=tom@talpey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox