]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
smb3: if max_channels set to more than one channel request multichannel
authorSteve French <stfrench@microsoft.com>
Sat, 8 May 2021 00:33:51 +0000 (19:33 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 12 May 2021 06:37:35 +0000 (08:37 +0200)
commit c1f8a398b6d661b594556a91224b096d92293061 upstream.

Mounting with "multichannel" is obviously implied if user requested
more than one channel on mount (ie mount parm max_channels>1).
Currently both have to be specified. Fix that so that if max_channels
is greater than 1 on mount, enable multichannel rather than silently
falling back to non-multichannel.

Signed-off-by: Steve French <stfrench@microsoft.com>
Reviewed-By: Tom Talpey <tom@talpey.com>
Cc: <stable@vger.kernel.org> # v5.11+
Reviewed-by: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/cifs/fs_context.c

index 73f14a13d37b261e1468e759bf56b931eefb6c22..8cb24e6836a044afb781ecf947666c2534c6ac6b 100644 (file)
@@ -978,6 +978,9 @@ static int smb3_fs_context_parse_param(struct fs_context *fc,
                        goto cifs_parse_mount_err;
                }
                ctx->max_channels = result.uint_32;
+               /* If more than one channel requested ... they want multichan */
+               if (result.uint_32 > 1)
+                       ctx->multichannel = true;
                break;
        case Opt_handletimeout:
                ctx->handle_timeout = result.uint_32;