[SRU][N:linux-azure][PATCH 1/1] smb: client: fix cifs_pick_channel when channel needs reconnect

Vinicius Peixoto vinicius.peixoto at canonical.com
Wed Feb 4 16:45:46 UTC 2026


From: Henrique Carvalho <henrique.carvalho at suse.com>

BugLink: https://launchpad.net/bugs/2140351

cifs_pick_channel iterates candidate channels using cur. The
reconnect-state test mistakenly used a different variable.

This checked the wrong slot and would cause us to skip a healthy channel
and to dispatch on one that needs reconnect, occasionally failing
operations when a channel was down.

Fix by replacing for the correct variable.

Fixes: fc43a8ac396d ("cifs: cifs_pick_channel should try selecting active channels")
Cc: stable at vger.kernel.org
Reviewed-by: Shyam Prasad N <sprasad at microsoft.com>
Signed-off-by: Henrique Carvalho <henrique.carvalho at suse.com>
Signed-off-by: Steve French <stfrench at microsoft.com>
(cherry picked from commit 79280191c2fd7f24899bbd640003b5389d3c109c)
Signed-off-by: Vinicius Peixoto <vinicius.peixoto at canonical.com>
---
 fs/smb/client/transport.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/smb/client/transport.c b/fs/smb/client/transport.c
index 7b2560612bd6a..d68100d30bb25 100644
--- a/fs/smb/client/transport.c
+++ b/fs/smb/client/transport.c
@@ -1038,7 +1038,7 @@ struct TCP_Server_Info *cifs_pick_channel(struct cifs_ses *ses)
 		if (!server || server->terminate)
 			continue;
 
-		if (CIFS_CHAN_NEEDS_RECONNECT(ses, i))
+		if (CIFS_CHAN_NEEDS_RECONNECT(ses, cur))
 			continue;
 
 		/*
-- 
2.51.0




More information about the kernel-team mailing list