From patchwork Sat Oct 1 16:54:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 12996613 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 DBF69C433FE for ; Sat, 1 Oct 2022 16:55:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229617AbiJAQzf (ORCPT ); Sat, 1 Oct 2022 12:55:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229744AbiJAQzL (ORCPT ); Sat, 1 Oct 2022 12:55:11 -0400 Received: from mail-vk1-xa36.google.com (mail-vk1-xa36.google.com [IPv6:2607:f8b0:4864:20::a36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FEE6264A0 for ; Sat, 1 Oct 2022 09:54:55 -0700 (PDT) Received: by mail-vk1-xa36.google.com with SMTP id bi53so3692635vkb.12 for ; Sat, 01 Oct 2022 09:54:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:mime-version:from:to:cc:subject :date; bh=IS18AKkvs6Ni+OLfS43Y4FnjRvwNRzH8XXbVwq68aoA=; b=TsYJAdoRgM4M/jM/6/oohzhNg5OJ0csO7MG9B6vYWTJZcTWd+VmmNR37Ri4r9Us+Tc Gy1D0zOSey9o4lkxHz1P/wuEo81O7sEIWy5jyaErkx3Glq1tQ8NIAF2aMEZXueee4xRg XJSxaOWuz5nTMtsK5gB+OXcKh2+EK79TLf/p+E8jYrzseTQsmEPvw187jp0LEseRo88U pdoXXTlRZpsIaqiSUXbbiGqYfUPOrCHjlvydDH58vgzDgUOy1xqjzfgcnUH/sgYmSJOL FdWKx7Fupl/LP2owpT6KIS0dare8tVfeNgxmiC6tPBLGVk5CoRkArpNAMBD78KvpZLrm XIoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date; bh=IS18AKkvs6Ni+OLfS43Y4FnjRvwNRzH8XXbVwq68aoA=; b=g66Xf7QVDBsCSnSz+bKSmhfT0nclvbx2Ma0EEdg9rV1sTDjyc30VxPF8XXkZ8dmPuw xrCCsnnhiTv1y2m1OuvsACh1Gd5r4akxPvn8YAPhRA8yhKGN/sH80vAexeJ5pqepDNZO t47X5L7XqQ1ZrOiNVoPn3pNvMhcVRJAuQyEBEXcGLOYaGyIBaR2i27bkT1WVkq7XK/yj WcEcS2w9qdcnysJk//Txo0JnrO7R28fqI0hHz9cNFb4efqnNZr/UHpeoK6KpLWbM8kXV a+k+LCngms9ick5K6L0zNNZdr1HFhj5tEpz7j718O4R1lkd1gP5ihhrvyO5yfD0+/4j9 NPsw== X-Gm-Message-State: ACrzQf3uPyo/Xq8wxaieDsTeJxJ7uPquvYFRT8JSkbHq/mpVrppE3mvm poqcngk0Ef3tMUnG+ECaPB4+X1GT/13z4J+lCrd74Cs4yxM= X-Google-Smtp-Source: AMsMyM66PwdUyNYg0aQe6ynKxht23H2THhvyK4vZB9qjMsiuLWbCvF9lD7HjKRIxpYFYkbJr2CkDpewOc4716Qul0cE= X-Received: by 2002:ac5:cb0a:0:b0:3a2:2fa3:87d8 with SMTP id r10-20020ac5cb0a000000b003a22fa387d8mr6352562vkl.3.1664643294079; Sat, 01 Oct 2022 09:54:54 -0700 (PDT) MIME-Version: 1.0 From: Steve French Date: Sat, 1 Oct 2022 11:54:43 -0500 Message-ID: Subject: [PATCH][smb3 client] log less confusing message on multichannel mounts to Samba when no interfaces returned To: CIFS Cc: samba-technical Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org Some servers can return an empty network interface list so, unless multichannel is requested, no need to log an error for this, and when multichannel is requested on mount but no interfaces, log something less confusing. For this case change parse_server_interfaces: malformed interface info to empty network interface list returned by server Cc: Signed-off-by: Steve French See attached patch Acked-by: Tom Talpey From 96a0af2c50ac5e454d1e896a9877a51ed100312b Mon Sep 17 00:00:00 2001 From: Steve French Date: Sat, 1 Oct 2022 11:44:08 -0500 Subject: [PATCH] smb3: do not log confusing message when server returns no network interfaces Some servers can return an empty network interface list so, unless multichannel is requested, no need to log an error for this, and when multichannel is requested on mount but no interfaces, log something less confusing. For this case change parse_server_interfaces: malformed interface info to empty network interface list returned by server Cc: Signed-off-by: Steve French --- fs/cifs/smb2ops.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index 5b0600939206..88cbf2890f6a 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -543,6 +543,17 @@ parse_server_interfaces(struct network_interface_info_ioctl_rsp *buf, } spin_unlock(&ses->iface_lock); + /* + * Samba server e.g. can return an empty interface list in some cases, + * which would only be a problem if we were requesting multichannel + */ + if (bytes_left == 0) { + if (ses->chan_max > 1) + cifs_dbg(VFS, "empty network interface list returned by server\n"); + rc = -EINVAL; + goto out; + } + while (bytes_left >= sizeof(*p)) { memset(&tmp_iface, 0, sizeof(tmp_iface)); tmp_iface.speed = le64_to_cpu(p->LinkSpeed); -- 2.34.1