diff mbox series

[CIFS] Fix support for remount when not changing rsize/wsize

Message ID CAH2r5mv6AXFVQ-QLsKMsYM5zqegf6bmmq=4rbFztj3JiJi_N1g@mail.gmail.com (mailing list archive)
State New, archived
Headers show
Series [CIFS] Fix support for remount when not changing rsize/wsize | expand

Commit Message

Steve French Dec. 17, 2020, 12:08 a.m. UTC
When remounting with the new mount API, we need to set
rsize and wsize to the previous values if they are not passed
in on the remount. Otherwise they get set to zero which breaks
xfstest 452 for example.

Signed-off-by: Steve French <stfrench@microsoft.com>
---
 fs/cifs/fs_context.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Shyam Prasad N Dec. 17, 2020, 3:56 a.m. UTC | #1
Looks good to me.

On Thu, Dec 17, 2020 at 5:39 AM Steve French <smfrench@gmail.com> wrote:
>
> When remounting with the new mount API, we need to set
> rsize and wsize to the previous values if they are not passed
> in on the remount. Otherwise they get set to zero which breaks
> xfstest 452 for example.
>
> Signed-off-by: Steve French <stfrench@microsoft.com>
> ---
>  fs/cifs/fs_context.c | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/fs/cifs/fs_context.c b/fs/cifs/fs_context.c
> index 734b30db580f..0afccbbed2e6 100644
> --- a/fs/cifs/fs_context.c
> +++ b/fs/cifs/fs_context.c
> @@ -707,6 +707,13 @@ static int smb3_reconfigure(struct fs_context *fc)
>   STEAL_STRING(cifs_sb, ctx, nodename);
>   STEAL_STRING(cifs_sb, ctx, iocharset);
>
> + /* if rsize or wsize not passed in on remount, use previous values */
> + if (ctx->rsize == 0)
> + ctx->rsize = cifs_sb->ctx->rsize;
> + if (ctx->wsize == 0)
> + ctx->wsize = cifs_sb->ctx->wsize;
> +
> +
>   smb3_cleanup_fs_context_contents(cifs_sb->ctx);
>   rc = smb3_fs_context_dup(cifs_sb->ctx, ctx);
>   smb3_update_mnt_flags(cifs_sb);
>
> --
> Thanks,
>
> Steve
diff mbox series

Patch

From 994abd27dbae6001739ab7bd203e8dad5dddd6b4 Mon Sep 17 00:00:00 2001
From: Steve French <stfrench@microsoft.com>
Date: Wed, 16 Dec 2020 18:04:27 -0600
Subject: [PATCH] cifs: Fix support for remount when not changing rsize/wsize

When remounting with the new mount API, we need to set
rsize and wsize to the previous values if they are not passed
in on the remount. Otherwise they get set to zero which breaks
xfstest 452 for example.

Signed-off-by: Steve French <stfrench@microsoft.com>
---
 fs/cifs/fs_context.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/fs/cifs/fs_context.c b/fs/cifs/fs_context.c
index 734b30db580f..0afccbbed2e6 100644
--- a/fs/cifs/fs_context.c
+++ b/fs/cifs/fs_context.c
@@ -707,6 +707,13 @@  static int smb3_reconfigure(struct fs_context *fc)
 	STEAL_STRING(cifs_sb, ctx, nodename);
 	STEAL_STRING(cifs_sb, ctx, iocharset);
 
+	/* if rsize or wsize not passed in on remount, use previous values */
+	if (ctx->rsize == 0)
+		ctx->rsize = cifs_sb->ctx->rsize;
+	if (ctx->wsize == 0)
+		ctx->wsize = cifs_sb->ctx->wsize;
+
+
 	smb3_cleanup_fs_context_contents(cifs_sb->ctx);
 	rc = smb3_fs_context_dup(cifs_sb->ctx, ctx);
 	smb3_update_mnt_flags(cifs_sb);
-- 
2.27.0