Re: [PATCH 9/9] smb: client: apply rasize on remount

From: Meetakshi Setiya

Date: Mon Apr 13 2026 - 09:37:04 EST


Hi Rajasi,

Before syncing the contexts, you should check if rasize has been
passed during remount at all. Else, we run the risk of overwriting
cifs_sb->ctx->rasize to 0 (the default value).
Please check how rsize and wsize handle this (a few lines above):

/* if rsize or wsize 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;

Thanks
Meetakshi

On Thu, Apr 9, 2026 at 3:08 AM <rajasimandalos@xxxxxxxxx> wrote:
>
> From: Rajasi Mandal <rajasimandal@xxxxxxxxxxxxx>
>
> 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@xxxxxxxxxxxxx>
> ---
> fs/smb/client/fs_context.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/fs/smb/client/fs_context.c b/fs/smb/client/fs_context.c
> index d804e5da578e..bba642442ae3 100644
> --- a/fs/smb/client/fs_context.c
> +++ b/fs/smb/client/fs_context.c
> @@ -1504,6 +1504,12 @@ static int smb3_reconfigure(struct fs_context *fc)
> smb3_cleanup_fs_context_contents(cifs_sb->ctx);
> rc = smb3_fs_context_dup(cifs_sb->ctx, ctx);
> 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
>
>