Linux CIFS filesystem development
 help / color / mirror / Atom feed
* [PATCH][SMB3 client] Server interface count incorrectly calculated
@ 2022-10-15 22:10 Steve French
  2022-10-17 21:03 ` Tom Talpey
  0 siblings, 1 reply; 4+ messages in thread
From: Steve French @ 2022-10-15 22:10 UTC (permalink / raw)
  To: CIFS; +Cc: Shyam Prasad N

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

smb3: interface count displayed incorrectly

The "Server interfaces" count in /proc/fs/cifs/DebugData increases
as the interfaces are requeried, rather than being reset to the new
value.  This could cause a problem if the server disabled
multichannel as the iface_count is checked in try_adding_channels
to see if multichannel still supported.

Cc: <stable@vger.kernel.org>

See attached

-- 
Thanks,

Steve

[-- Attachment #2: 0001-smb3-interface-count-displayed-incorrectly.patch --]
[-- Type: text/x-patch, Size: 1080 bytes --]

From 1d2aef099583e39610580d20fb86f6f99b64c782 Mon Sep 17 00:00:00 2001
From: Steve French <stfrench@microsoft.com>
Date: Sat, 15 Oct 2022 17:02:30 -0500
Subject: [PATCH] smb3: interface count displayed incorrectly

The "Server interfaces" count in /proc/fs/cifs/DebugData increases
as the interfaces are requeried, rather than being reset to the new
value.  This could cause a problem if the server disabled
multichannel as the iface_count is checked in try_adding_channels
to see if multichannel still supported.

Cc: <stable@vger.kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
---
 fs/cifs/smb2ops.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
index 17b25153cb68..7ee1dd635faf 100644
--- a/fs/cifs/smb2ops.c
+++ b/fs/cifs/smb2ops.c
@@ -530,6 +530,7 @@ parse_server_interfaces(struct network_interface_info_ioctl_rsp *buf,
 	p = buf;
 
 	spin_lock(&ses->iface_lock);
+	ses->iface_count = 0;
 	/*
 	 * Go through iface_list and do kref_put to remove
 	 * any unused ifaces. ifaces in use will be removed
-- 
2.34.1


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

end of thread, other threads:[~2022-10-20  5:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-15 22:10 [PATCH][SMB3 client] Server interface count incorrectly calculated Steve French
2022-10-17 21:03 ` Tom Talpey
     [not found]   ` <CAH2r5muH+n6TYS3_O9pbwREWJ_GYuva_PvOLd88pxG+t9kVeCA@mail.gmail.com>
2022-10-17 21:28     ` Tom Talpey
     [not found]       ` <CAH2r5mvwy+foxWEznbD4R28=kv4-zdAqGwc7UTgH0WeCAceVEw@mail.gmail.com>
2022-10-20  5:47         ` Shyam Prasad N

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