Linux-CIFS Archive mirror
 help / color / mirror / Atom feed
From: rajasimandalos@gmail.com
To: sfrench@samba.org, linux-cifs@vger.kernel.org
Cc: rajasimandalos@gmail.com, Rajasi Mandal <rajasimandal@microsoft.com>
Subject: [PATCH v2] smb: client: sync echo_interval on remount
Date: Wed, 22 Apr 2026 04:42:30 +0000	[thread overview]
Message-ID: <20260422044230.1127071-1-rajasimandalos@gmail.com> (raw)
In-Reply-To: <20260409095926.905020-5-rajasimandalos@gmail.com>

From: Rajasi Mandal <rajasimandal@microsoft.com>

echo_interval is accepted during remount parsing but
server->echo_interval is only set in cifs_get_tcp_session() at
connection setup. A remount with a new echo_interval value silently
has no effect on the echo keepalive timer.

Add echo_interval to smb3_sync_server_opts() under srv_lock so the
new interval is pushed to the live server struct. Reschedule the echo
delayed work via mod_delayed_work() so the new interval takes effect
immediately rather than after the current timer fires.

Signed-off-by: Rajasi Mandal <rajasimandal@microsoft.com>
---
 fs/smb/client/fs_context.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/fs/smb/client/fs_context.c b/fs/smb/client/fs_context.c
index fd1060483bf2..45173f287f00 100644
--- a/fs/smb/client/fs_context.c
+++ b/fs/smb/client/fs_context.c
@@ -1329,9 +1329,9 @@ static void smb3_sync_tcon_opts(struct cifs_sb_info *cifs_sb,
 
 /*
  * Synchronize server-level options that are stored on TCP_Server_Info
- * at mount time.  These fields are consulted at runtime (retry logic)
- * so remount needs to update the live server struct in addition to
- * cifs_sb->ctx.
+ * at mount time.  These fields are consulted at runtime (echo work,
+ * retry logic) so remount needs to update the live server struct in
+ * addition to cifs_sb->ctx.
  */
 static void smb3_sync_server_opts(struct cifs_sb_info *cifs_sb)
 {
@@ -1341,7 +1341,13 @@ static void smb3_sync_server_opts(struct cifs_sb_info *cifs_sb)
 	spin_lock(&server->srv_lock);
 	if (ctx->retrans)
 		server->retrans = ctx->retrans;
+	if (ctx->echo_interval)
+		server->echo_interval = ctx->echo_interval * HZ;
 	spin_unlock(&server->srv_lock);
+
+	if (ctx->echo_interval)
+		mod_delayed_work(cifsiod_wq, &server->echo,
+				 server->echo_interval);
 }
 
 static int smb3_reconfigure(struct fs_context *fc)
-- 
2.43.0


  reply	other threads:[~2026-04-22  4:42 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-09  9:59 [PATCH 1/9] smb: client: block non-reconfigurable option changes on remount rajasimandalos
2026-04-09  9:59 ` [PATCH 2/9] smb: client: allow both 'lease' and 'nolease' mount options rajasimandalos
2026-04-13 13:30   ` Meetakshi Setiya
2026-04-09  9:59 ` [PATCH 3/9] smb: client: sync tcon-level options on remount rajasimandalos
2026-04-17 14:29   ` Meetakshi Setiya
2026-04-09  9:59 ` [PATCH 4/9] smb: client: sync retrans " rajasimandalos
2026-04-09  9:59 ` [PATCH 5/9] smb: client: sync echo_interval " rajasimandalos
2026-04-22  4:42   ` rajasimandalos [this message]
2026-04-09  9:59 ` [PATCH 6/9] smb: client: allow nolease option to be reconfigured " rajasimandalos
2026-04-22  5:06   ` [PATCH v2] " rajasimandalos
2026-04-22  8:36     ` Bharath SM
2026-04-22 15:29       ` Steve French
2026-04-09  9:59 ` [PATCH 7/9] smb: client: block cache=ro and cache=singleclient " rajasimandalos
2026-04-13 13:40   ` Meetakshi Setiya
2026-04-22  4:34     ` RAJASI MANDAL
2026-04-09  9:59 ` [PATCH 8/9] smb: client: fix domainauto remount by syncing domainname from session rajasimandalos
2026-04-09  9:59 ` [PATCH 9/9] smb: client: apply rasize on remount rajasimandalos
2026-04-13 13:29   ` Meetakshi Setiya
2026-04-13  7:32 ` [PATCH v2 1/9] smb: client: block non-reconfigurable option changes " Rajasi Mandal
2026-04-17 14:05   ` Meetakshi Setiya

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=20260422044230.1127071-1-rajasimandalos@gmail.com \
    --to=rajasimandalos@gmail.com \
    --cc=linux-cifs@vger.kernel.org \
    --cc=rajasimandal@microsoft.com \
    --cc=sfrench@samba.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).