summaryrefslogtreecommitdiff
path: root/fs/cifs
diff options
context:
space:
mode:
authorSteve French <stfrench@microsoft.com>2020-06-03 07:17:16 +0300
committerSteve French <stfrench@microsoft.com>2020-06-04 09:13:37 +0300
commit1ee0e6d47d08ef309e0975a96d643972855511d0 (patch)
tree68a2432447f99e4306d49f86b272714dff9d0a9c /fs/cifs
parent5f68ea4aa98bcddb5ec5229d2a0933d84ed17732 (diff)
downloadlinux-1ee0e6d47d08ef309e0975a96d643972855511d0.tar.xz
smb3: default to minimum of two channels when multichannel specified
When "multichannel" is specified on mount, make sure to default to at least two channels. Signed-off-by: Steve French <stfrench@microsoft.com> Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/connect.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index daf90f988de1..fdfd7cf4c720 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -1964,9 +1964,13 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
break;
case Opt_multichannel:
vol->multichannel = true;
+ /* if number of channels not specified, default to 2 */
+ if (vol->max_channels < 2)
+ vol->max_channels = 2;
break;
case Opt_nomultichannel:
vol->multichannel = false;
+ vol->max_channels = 1;
break;
case Opt_compress:
vol->compression = UNKNOWN_TYPE;