From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 275503D7D94 for ; Tue, 16 Jun 2026 05:54:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781589257; cv=none; b=CB9qfK6HNXP8KF2ybSqOPVviCfJkBdxaVooI1fce0DrTT2vkSmjNry9bepYOzyLUtd2Ji9wgEEUw4b6y2TUo5g06E8+6Im8K5x0bW8+mF1EquBJn+S6uNqwW8kCL12hOjIOGvBa6TXzmQkiiVazzXT+4H+FHyhj5hEir3bOw6oI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781589257; c=relaxed/simple; bh=nhK5erLPMld59NqJFTXEr32ELobTHwtHREBLVNCVBQU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XWytUCxrfESR4xumX9TVKWNsQdEa60TM4yX3UcGCzt3GdHAHS+ZLpW0ygxpBaXH8DU61KX/sgT8UmJVZ3w4Uwwm1KoqCFa1igjgWpsJPdMT4xfe9jo96Oa2TTL3XelvYYYz/dtzxuVP3qzR/gIiWJ0SoBE3sNPnCLRG6Mnd2K+4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=VF1jOOGS; arc=none smtp.client-ip=209.85.214.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VF1jOOGS" Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-2bf125989f2so30006155ad.3 for ; Mon, 15 Jun 2026 22:54:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781589255; x=1782194055; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=a2WHE69XCvPsuob7aME3t/R6BnMk/X5IWMhOHC9uOQw=; b=VF1jOOGSIZdWpBUdGaRH1mg5+uzle+N9cI94DENkgIS2HAY501A34n8DPSlpY/qICC Z5Cluxj6uVEq5CRodJ85gtzbvcParHAblyZ+rnLW4vi/RRA7H1oWlC9BEP1UtOQXC1Fh wt5tJoLrU9fZmyGtQbXFrf65LKHT2tytXX2HkD9BsY+X97MqixtqSQ7VqKr+Dg8gk1km sAKNeGDMaJHmygKczwjeVyoLwnUyzCjRNzS5oQxgG+fIl3rGzt8mXJIUYDz/duPUTirA pQV39OQxHNlNSO1k5ZYxoZSBdl63AcSLiMjS2fR09Af66SY12WVx+49Q+/51I5D7i+5X lH+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781589255; x=1782194055; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=a2WHE69XCvPsuob7aME3t/R6BnMk/X5IWMhOHC9uOQw=; b=cvSDyXxDH7CroOhGjNu+MKGAeecvXu3GL5Z6eCRAGrlwjOOimLZhQql6xm7l4v8tdO Tdqg0sY77LY38VznTUlezSyTiibq+kLhTS1M2Ng6Aw86pDBmD/GmiOiZAXkHQOBu2Lng Yl+oaqxFnDIlh5R5IWjMJYgcLcqFl1xkHYQ2MO31xjW4r2R1nNMEigqYhYc6cFQTi4Xj c/B+zmNabNhQj4XRr9ioE2AJo992i9FpjKYpDFNrSd9J0k2s/GxMRvNXC7P4vIwgg5t5 lw3Kfcq239LRQMxUxPT7mhAQD1Nni05Zx2J9daYVU4W8LR7ORX8V8Vk+5PirFjeER+k8 4AkQ== X-Forwarded-Encrypted: i=1; AFNElJ/P2vr7kkO5sL/BktiuIZ8iEEFVug1/xN+hI2Fpyap1OPG3JVMhVoydW6Z03UjDjc2ukAxAEvw4MNFepNE=@vger.kernel.org X-Gm-Message-State: AOJu0YwIQbZp+nvd1Ygb6sJITJ4yeLqCi3/ihwXVTrfEbDaW5gsqGPe0 fzii2OgdSCBVzJRWZbDtgo5dUCqRqs3mjURPdAagtfTqsoOIovrFJ3sQ X-Gm-Gg: Acq92OEV+Dc/Urcs7b6Opte62sbqt1X/De3O9A5YIzuLzIs/RM4mGO6efGtsCSo5yGY i+YZTW9JhBRiuUk1PaiS+aBDhOm0Eae82B5DOt2HLqSBf7QqIDvoEg7BpzKHUwhJe3VeGFr2pi/ NyeMOwuWr3tcmvIBMpDGBxHtJNwr2BU1Oqw6hNRWsYG9SWa1fcQ1zpY/nEpAPvk/CjV0A6kIcTl Sl+j7I/zXzmPMIZRDTxdAL2qW4QGBd/gbc4FTEOlVM/xofuuQ9kx3DXC3voyHn60TaEejnVzQ06 8btGbnHkkxzlCyMdDddPkE1JCH+W5anlMyuYiyqenKILqzmbEAHNNV0IA2X7PS9BkDkFIS0p2Mb nhcaEAKwOZ87PhqpFAqG3N2UY+zrkxCJTf74q0eNetkP7S4s9jDe0s1Y/ZMYSsWO+JUSvCZHLZC ItPh7eMAwRd77eYwEFyppfD7qns1HA95V0Oy+W2U0wnES72N52u6JrfdJ/uiGIBsxGys+VUSSyC 7LuDxFOBLQXpA9KpK83F+Y= X-Received: by 2002:a17:903:2f44:b0:2c0:cb0e:ac3a with SMTP id d9443c01a7336-2c69a1678c4mr23532235ad.23.1781589255443; Mon, 15 Jun 2026 22:54:15 -0700 (PDT) Received: from dev-vm-rm.hzz4ddxqtfeetjrh00qlbgyytb.rx.internal.cloudapp.net ([20.197.52.255]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2c42f2e52b5sm120805275ad.7.2026.06.15.22.54.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jun 2026 22:54:15 -0700 (PDT) From: rajasimandalos@gmail.com To: Steve French , Paulo Alcantara , Ronnie Sahlberg , Shyam Prasad N , Tom Talpey , Bharath SM Cc: linux-cifs@vger.kernel.org, linux-kernel@vger.kernel.org, Meetakshi Setiya , Rajasi Mandal , Meetakshi Setiya Subject: [PATCH v4 3/7] smb: client: sync retrans on remount Date: Tue, 16 Jun 2026 05:53:53 +0000 Message-ID: <20260616055357.3798387-4-rajasimandalos@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260616055357.3798387-1-rajasimandalos@gmail.com> References: <20260616055357.3798387-1-rajasimandalos@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Rajasi Mandal The retrans mount option controls how many times the client retries sending a request before giving up. Although remount already stored the new value in cifs_sb->ctx, it was never propagated to server->retrans, so the running connection kept using the old count. Introduce smb3_sync_server_opts() to push ctx options that live on TCP_Server_Info into the live server struct after a successful remount. For now it handles retrans; subsequent patches will extend it to other server-level knobs. The previous patch in this series ("smb: client: sync runtime state into ctx on reconfigure") duplicates the existing context on remount, so a bare 'mount -o remount' carries the old retrans value forward and the parser only overwrites it when the user explicitly passes retrans=N. No special-casing for the bare-remount /proc/mounts replay is therefore needed; in particular, an explicit retrans=0 from the user now correctly resets the value to the compile-time default. Writes to server->retrans are unsynchronized to match the existing convention: every other reader of the field (smb2ops.c retry path, cifs_show_options(), the original cifs_get_tcp_session() writer) does not take server->srv_lock, and match_server() only reads it under srv_lock as part of the larger match function. Note that retrans lives on TCP_Server_Info and is therefore shared across all mounts to the same server; reconfiguring one mount updates the value seen by every other mount sharing the connection. This is consistent with the existing semantics: cifs_show_options() already reads server->retrans for /proc/mounts on every mount, and the runtime retry path always uses the server's value rather than any per-mount copy. Signed-off-by: Rajasi Mandal Reviewed-by: Meetakshi Setiya --- fs/smb/client/fs_context.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/fs/smb/client/fs_context.c b/fs/smb/client/fs_context.c index d5a7d4dd402b..bfbea0648f6a 100644 --- a/fs/smb/client/fs_context.c +++ b/fs/smb/client/fs_context.c @@ -1278,6 +1278,24 @@ static void smb3_sync_ses_chan_max(struct cifs_ses *ses, size_t max_channels) spin_unlock(&ses->chan_lock); } +/* + * 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. Note these live on TCP_Server_Info and are therefore + * shared across all mounts to the same server; reconfiguring one mount + * updates the value seen by every other mount sharing the connection, + * matching how cifs_show_options() and the runtime retry path already + * read them unsynchronized from the server struct. + */ +static void smb3_sync_server_opts(struct cifs_sb_info *cifs_sb) +{ + struct TCP_Server_Info *server = cifs_sb_master_tcon(cifs_sb)->ses->server; + struct smb3_fs_context *ctx = cifs_sb->ctx; + + server->retrans = ctx->retrans; +} + static int smb3_reconfigure(struct fs_context *fc) { struct smb3_fs_context *ctx = smb3_fc2context(fc); @@ -1447,6 +1465,8 @@ static int smb3_reconfigure(struct fs_context *fc) if (!rc) rc = dfs_cache_remount_fs(cifs_sb); #endif + if (!rc) + smb3_sync_server_opts(cifs_sb); return rc; -- 2.43.0