diff mbox series

[SMB3] default to minimum of two channels when multichannel specified

Message ID CAH2r5msvShbNa-X5-ZH-H66W2Kc_sZ3g+XDwns2_zR3P9ZCMtg@mail.gmail.com (mailing list archive)
State New, archived
Headers show
Series [SMB3] default to minimum of two channels when multichannel specified | expand

Commit Message

Steve French June 3, 2020, 4:21 a.m. UTC
When "multichannel" is specified on mount, make sure to default to
    at least two channels.

Comments

Aurélien Aptel June 3, 2020, 8:07 a.m. UTC | #1
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
diff mbox series

Patch

From ed58e117d1dc4b8aa317b251626958b5ffb06f5d Mon Sep 17 00:00:00 2001
From: Steve French <stfrench@microsoft.com>
Date: Tue, 2 Jun 2020 23:17:16 -0500
Subject: [PATCH] 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>
---
 fs/cifs/connect.c | 4 ++++
 1 file changed, 4 insertions(+)

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;
-- 
2.25.1