From: Steve French Date: Wed, 3 Jun 2020 04:17:16 +0000 (-0500) Subject: smb3: default to minimum of two channels when multichannel specified X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=1ee0e6d47d08ef309e0975a96d643972855511d0;p=linux.git 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 Reviewed-by: Ronnie Sahlberg --- diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index daf90f988de1e..fdfd7cf4c720a 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;