Linux CIFS filesystem development
 help / color / mirror / Atom feed
* [PATCH][smb3 client] log less confusing message on multichannel mounts to Samba when no interfaces returned
@ 2022-10-01 16:54 Steve French
  2022-10-01 23:22 ` Tom Talpey
  0 siblings, 1 reply; 8+ messages in thread
From: Steve French @ 2022-10-01 16:54 UTC (permalink / raw)
  To: CIFS; +Cc: samba-technical

[-- Attachment #1: Type: text/plain, Size: 473 bytes --]

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: <stable@vger.kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>

See attached patch

-- 
Thanks,

Steve

[-- Attachment #2: 0001-smb3-do-not-log-confusing-message-when-server-return.patch --]
[-- Type: text/x-patch, Size: 1480 bytes --]

From 96a0af2c50ac5e454d1e896a9877a51ed100312b Mon Sep 17 00:00:00 2001
From: Steve French <stfrench@microsoft.com>
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: <stable@vger.kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
---
 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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-10-12  4:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-01 16:54 [PATCH][smb3 client] log less confusing message on multichannel mounts to Samba when no interfaces returned Steve French
2022-10-01 23:22 ` Tom Talpey
2022-10-03  4:38   ` Steve French
2022-10-03 14:21     ` Tom Talpey
2022-10-03 22:32       ` Steve French
2022-10-03 22:36         ` Steve French
2022-10-11 19:39           ` Tom Talpey
2022-10-12  4:32             ` Steve French

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox