From patchwork Wed Feb 16 22:48:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 12749151 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 75BF6C433F5 for ; Wed, 16 Feb 2022 22:49:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235675AbiBPWtY (ORCPT ); Wed, 16 Feb 2022 17:49:24 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:33898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231648AbiBPWtX (ORCPT ); Wed, 16 Feb 2022 17:49:23 -0500 Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FE4B136EC9 for ; Wed, 16 Feb 2022 14:49:10 -0800 (PST) Received: by mail-lj1-x229.google.com with SMTP id u16so5621135ljk.2 for ; Wed, 16 Feb 2022 14:49:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to:cc; bh=Q31rtfyaobui8qJN/QBLDC17+V6SvrQaLFnkshht8bc=; b=gy1dG/U9u7gHNTpXyBaHktkpEUFM1MQ5OpzzQjET1ac9IPXilZLjMcGGaQAQ7wwGM8 5wQlZXKYUVxUXqOS+q/1AbBCelf+7pyXLMSnnSof2E//Eqxbz1nQ0qMDl0SU3n2YOXGk Hap8+R/kKrwdJO8q1wcuFy2vzzteOhwApggcdtYpetK+0uf04W7gp8rnTFmXBaL5fDZi ERSTymV6kj4Uv8o1T/zIfw4dlyIV/+Jqwa1gwo3DuKjcrWP0rJs6Myy6I42y3wIqXgHN p9pxah9Hvc1Ner+QdPV+uh8MKmnyd3lym0XUKcSrznrrnHGGK2IeSzrv2jBfxu7cFaT7 Bmcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=Q31rtfyaobui8qJN/QBLDC17+V6SvrQaLFnkshht8bc=; b=PQl1LB6i4RLU/4ZC1FMCVyRZSPrfI/fDK+d3M/XLxcp+p8XYqpL8K9NMKZyJ6tdjuT 2fy7HhYnxBuGSHAIec8ffdm69gpc7Oc8UqCAlpoLxp5xnJfAXj/O3o9SPVvQCP+/VG7Y dTyZWCtjWQsHfiG96m7H8m5s6YxXHzx7njRmS+kpDispaBgW5CGgYlr2WzQn0yO8sjLR Yy1qKHhtH9Fd8Qg0+AXk6anLKygPerntfrg2caU8VOA2NM/v8NfaDTP0topjQWdfbR0q 26X8P1yG484/YNA8yylmvMMlZxnetwvP7txl/Q5t5yjUNW6hac45xQDU58P8u16KlCXu YNMw== X-Gm-Message-State: AOAM530JR3wA1o6d9vaOG+hwVWbxld7EDcSs8YzDRHUVARE8v/73YpTA t+vEahRcA2qsmuridkVvFWNMtyiDfik3h06G/AC9GjUxHjZyXg== X-Google-Smtp-Source: ABdhPJwgtnVtP7CBAlKDp2NXhW7FBV6hIrvguOjYNN1pepe4QMa3c3Z+MV/s/gmuNhSO665hXuSaiY5uAqs7O/32NgA= X-Received: by 2002:a2e:9ad5:0:b0:246:853:1826 with SMTP id p21-20020a2e9ad5000000b0024608531826mr170279ljj.398.1645051748569; Wed, 16 Feb 2022 14:49:08 -0800 (PST) MIME-Version: 1.0 From: Steve French Date: Wed, 16 Feb 2022 16:48:57 -0600 Message-ID: Subject: [PATCH][CIFS] fix confusing unneeded warning message on smb2.1 and earlier To: CIFS Cc: Shyam Prasad N Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org 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 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); From ac3af6e6855275a40bf2e544f10c840cf84506f9 Mon Sep 17 00:00:00 2001 From: Steve French 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 --- 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