diff mbox series

[CIFS] fix confusing unneeded warning message on smb2.1 and earlier

Message ID CAH2r5msWKHzDMgXZkifGYgM5ueQA4X613zM4KFGXEZbXyw8ZiA@mail.gmail.com (mailing list archive)
State New, archived
Headers show
Series [CIFS] fix confusing unneeded warning message on smb2.1 and earlier | expand

Commit Message

Steve French Feb. 16, 2022, 10:48 p.m. UTC
When mounting with SMB2.1 or earlier, even with nomultichannel, we
    log the confusing warning message:
      "CIFS: VFS: multichannel is not supported on this protocol
version, use 3.0 or above"

    Fix this so that we don't log this unless they really are trying
    to mount with multichannel.

    Cc: stable@vger.kernel.org # 5.11+
    Signed-off-by: Steve French <stfrench@microsoft.com>


        new_chan_count = old_chan_count = ses->chan_count;
@@ -145,6 +140,12 @@ int cifs_try_adding_channels(struct cifs_sb_info
*cifs_sb, struct cifs_ses *ses)
                return 0;
        }

+       if (ses->server->dialect < SMB30_PROT_ID) {
+               spin_unlock(&ses->chan_lock);
+               cifs_dbg(VFS, "multichannel is not supported on this
protocol version, use 3.0 or above\n");
+               return 0;
+       }
+
        if (!(ses->server->capabilities & SMB2_GLOBAL_CAP_MULTI_CHANNEL)) {
                ses->chan_max = 1;
                spin_unlock(&ses->chan_lock);
diff mbox series

Patch

From ac3af6e6855275a40bf2e544f10c840cf84506f9 Mon Sep 17 00:00:00 2001
From: Steve French <stfrench@microsoft.com>
Date: Wed, 16 Feb 2022 13:23:53 -0600
Subject: [PATCH] cifs: fix confusing unneeded warning message on smb2.1 and
 earlier

When mounting with SMB2.1 or earlier, even with nomultichannel, we
log the confusing warning message:
  "CIFS: VFS: multichannel is not supported on this protocol version, use 3.0 or above"

Fix this so that we don't log this unless they really are trying
to mount with multichannel.

Cc: stable@vger.kernel.org # 5.11+
Signed-off-by: Steve French <stfrench@microsoft.com>
---
 fs/cifs/sess.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c
index 5723d50340e5..32f478c7a66d 100644
--- a/fs/cifs/sess.c
+++ b/fs/cifs/sess.c
@@ -127,11 +127,6 @@  int cifs_try_adding_channels(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses)
 	struct cifs_server_iface *ifaces = NULL;
 	size_t iface_count;
 
-	if (ses->server->dialect < SMB30_PROT_ID) {
-		cifs_dbg(VFS, "multichannel is not supported on this protocol version, use 3.0 or above\n");
-		return 0;
-	}
-
 	spin_lock(&ses->chan_lock);
 
 	new_chan_count = old_chan_count = ses->chan_count;
@@ -145,6 +140,12 @@  int cifs_try_adding_channels(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses)
 		return 0;
 	}
 
+	if (ses->server->dialect < SMB30_PROT_ID) {
+		spin_unlock(&ses->chan_lock);
+		cifs_dbg(VFS, "multichannel is not supported on this protocol version, use 3.0 or above\n");
+		return 0;
+	}
+
 	if (!(ses->server->capabilities & SMB2_GLOBAL_CAP_MULTI_CHANNEL)) {
 		ses->chan_max = 1;
 		spin_unlock(&ses->chan_lock);
-- 
2.32.0