]> git.baikalelectronics.ru Git - kernel.git/commitdiff
smb3: default to minimum of two channels when multichannel specified
authorSteve French <stfrench@microsoft.com>
Wed, 3 Jun 2020 04:17:16 +0000 (23:17 -0500)
committerSteve French <stfrench@microsoft.com>
Thu, 4 Jun 2020 06:13:37 +0000 (01:13 -0500)
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>
fs/cifs/connect.c

index daf90f988de1e0d05f15506e62447513a9a47de5..fdfd7cf4c720abcb78316596cf04ca340b3c6867 100644 (file)
@@ -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;