]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
cifs: reset iface weights when we cannot find a candidate
authorShyam Prasad N <sprasad@microsoft.com>
Mon, 18 Aug 2025 18:40:33 +0000 (14:40 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:26:10 +0000 (16:26 +0200)
commit4588a94a2da62dff752f2aeea8de0301f54cb4fb
tree04794aea87c1542575f8d55d40fa01cc20067617
parent24adef4f4f455ff04ea089bf9793e968ca1a1faa
cifs: reset iface weights when we cannot find a candidate

[ Upstream commit 9d5eff7821f6d70f7d1b4d8a60680fba4de868a7 ]

We now do a weighted selection of server interfaces when allocating
new channels. The weights are decided based on the speed advertised.
The fulfilled weight for an interface is a counter that is used to
track the interface selection. It should be reset back to zero once
all interfaces fulfilling their weight.

In cifs_chan_update_iface, this reset logic was missing. As a result
when the server interface list changes, the client may not be able
to find a new candidate for other channels after all interfaces have
been fulfilled.

Fixes: a6d8fb54a515 ("cifs: distribute channels across interfaces based on speed")
Cc: <stable@vger.kernel.org>
Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
[ Kept both int rc and int retry variables ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/smb/client/sess.c