From: rajasimandalos@gmail.com
To: Steve French <sfrench@samba.org>,
Paulo Alcantara <pc@manguebit.org>,
Ronnie Sahlberg <ronniesahlberg@gmail.com>,
Shyam Prasad N <sprasad@microsoft.com>,
Tom Talpey <tom@talpey.com>, Bharath SM <bharathsm@microsoft.com>
Cc: linux-cifs@vger.kernel.org, linux-kernel@vger.kernel.org,
Meetakshi Setiya <meetakshisetiyaoss@gmail.com>,
Rajasi Mandal <rajasimandal@microsoft.com>,
Meetakshi Setiya <msetiya@microsoft.com>
Subject: [PATCH v4 5/7] smb: client: apply rasize on remount
Date: Tue, 16 Jun 2026 05:53:55 +0000 [thread overview]
Message-ID: <20260616055357.3798387-6-rajasimandalos@gmail.com> (raw)
In-Reply-To: <20260616055357.3798387-1-rajasimandalos@gmail.com>
From: Rajasi Mandal <rajasimandal@microsoft.com>
rasize is accepted during remount parsing but sb->s_bdi->ra_pages is
only set in cifs_read_super() at mount time. A remount with a new
rasize value silently has no effect on the readahead window.
Update ra_pages in smb3_reconfigure() after the context has been
duplicated, using the same logic as cifs_read_super(): if rasize is
set, use it directly; otherwise fall back to 2 * rsize.
Signed-off-by: Rajasi Mandal <rajasimandal@microsoft.com>
Reviewed-by: Meetakshi Setiya <msetiya@microsoft.com>
---
fs/smb/client/fs_context.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/fs/smb/client/fs_context.c b/fs/smb/client/fs_context.c
index 659fb0adb528..0a72e1089ff7 100644
--- a/fs/smb/client/fs_context.c
+++ b/fs/smb/client/fs_context.c
@@ -1313,7 +1313,7 @@ static int smb3_reconfigure(struct fs_context *fc)
struct dentry *root = fc->root;
struct cifs_sb_info *cifs_sb = CIFS_SB(root->d_sb);
struct cifs_ses *ses = cifs_sb_master_tcon(cifs_sb)->ses;
- unsigned int rsize = ctx->rsize, wsize = ctx->wsize;
+ unsigned int rsize = ctx->rsize, wsize = ctx->wsize, rasize = ctx->rasize;
char *new_password = NULL, *new_password2 = NULL;
bool need_recon = false;
bool need_mchan_update;
@@ -1379,9 +1379,10 @@ static int smb3_reconfigure(struct fs_context *fc)
STEAL_STRING_SENSITIVE(cifs_sb, ctx, password2);
}
- /* if rsize or wsize not passed in on remount, use previous values */
+ /* if rsize, wsize, or rasize not passed in on remount, use previous values */
ctx->rsize = rsize ? CIFS_ALIGN_RSIZE(fc, rsize) : cifs_sb->ctx->rsize;
ctx->wsize = wsize ? CIFS_ALIGN_WSIZE(fc, wsize) : cifs_sb->ctx->wsize;
+ ctx->rasize = rasize ? rasize : cifs_sb->ctx->rasize;
new_ctx = kzalloc_obj(*new_ctx);
if (!new_ctx) {
@@ -1470,6 +1471,12 @@ static int smb3_reconfigure(struct fs_context *fc)
smb3_cleanup_fs_context(old_ctx);
old_ctx = NULL;
smb3_update_mnt_flags(cifs_sb);
+
+ if (cifs_sb->ctx->rasize)
+ root->d_sb->s_bdi->ra_pages = cifs_sb->ctx->rasize / PAGE_SIZE;
+ else
+ root->d_sb->s_bdi->ra_pages = 2 * (cifs_sb->ctx->rsize / PAGE_SIZE);
+
#ifdef CONFIG_CIFS_DFS_UPCALL
if (!rc)
rc = dfs_cache_remount_fs(cifs_sb);
--
2.43.0
next prev parent reply other threads:[~2026-06-16 5:54 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-16 5:53 [PATCH v4 0/7] smb: client: make more mount options take effect " rajasimandalos
2026-06-16 5:53 ` [PATCH v4 1/7] smb: client: sync runtime state into ctx on reconfigure rajasimandalos
2026-06-16 6:44 ` Meetakshi Setiya
2026-06-16 5:53 ` [PATCH v4 2/7] smb: client: block non-reconfigurable option changes on remount rajasimandalos
2026-06-16 6:44 ` Meetakshi Setiya
2026-06-16 5:53 ` [PATCH v4 3/7] smb: client: sync retrans " rajasimandalos
2026-06-16 7:37 ` Meetakshi Setiya
2026-06-16 5:53 ` [PATCH v4 4/7] smb: client: block cache=ro and cache=singleclient " rajasimandalos
2026-06-16 7:40 ` Meetakshi Setiya
2026-06-16 5:53 ` rajasimandalos [this message]
2026-06-16 7:41 ` [PATCH v4 5/7] smb: client: apply rasize " Meetakshi Setiya
2026-06-16 5:53 ` [PATCH v4 6/7] smb: client: move struct tcon_list to cifsglob.h rajasimandalos
2026-06-16 5:53 ` [PATCH v4 7/7] smb: client: allow nolease option to be reconfigured on remount rajasimandalos
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=20260616055357.3798387-6-rajasimandalos@gmail.com \
--to=rajasimandalos@gmail.com \
--cc=bharathsm@microsoft.com \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=meetakshisetiyaoss@gmail.com \
--cc=msetiya@microsoft.com \
--cc=pc@manguebit.org \
--cc=rajasimandal@microsoft.com \
--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
all inboxes | Powered by JetHome®