summaryrefslogtreecommitdiff
path: root/fs/cifs/connect.c
diff options
context:
space:
mode:
authorSteve French <stfrench@microsoft.com>2020-12-15 22:28:50 +0300
committerSteve French <stfrench@microsoft.com>2020-12-16 00:13:59 +0300
commit0c2b5f7ce50c24099e8ed7d35936e89fe9ca26ff (patch)
tree69bca9d6751b81ee73d10444765c276deaaccf6f /fs/cifs/connect.c
parent09a8361e3b681ef6b56cc56f7b2905b4455d6774 (diff)
downloadlinux-0c2b5f7ce50c24099e8ed7d35936e89fe9ca26ff.tar.xz
cifs: fix rsize/wsize to be negotiated values
Also make sure these are displayed in /proc/mounts Signed-off-by: Steve French <stfrench@microsoft.com> Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r--fs/cifs/connect.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index de747ee40e87..64a41b32fbb1 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -2859,10 +2859,14 @@ static int mount_get_conns(struct smb3_fs_context *ctx, struct cifs_sb_info *cif
/*
* Clamp the rsize/wsize mount arguments if they are too big for the server
+ * and set the rsize/wsize to the negotiated values if not passed in by
+ * the user on mount
*/
- if (cifs_sb->ctx->wsize > server->ops->negotiate_wsize(tcon, ctx))
+ if ((cifs_sb->ctx->wsize == 0) ||
+ (cifs_sb->ctx->wsize > server->ops->negotiate_wsize(tcon, ctx)))
cifs_sb->ctx->wsize = server->ops->negotiate_wsize(tcon, ctx);
- if (cifs_sb->ctx->rsize > server->ops->negotiate_rsize(tcon, ctx))
+ if ((cifs_sb->ctx->rsize == 0) ||
+ (cifs_sb->ctx->rsize > server->ops->negotiate_rsize(tcon, ctx)))
cifs_sb->ctx->rsize = server->ops->negotiate_rsize(tcon, ctx);
return 0;