summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenrique Carvalho <henrique.carvalho@suse.com>2025-11-07 18:59:53 -0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-11-24 10:36:02 +0100
commit21b7af43f19af983a35b7c543805ece7bc3ac04f (patch)
tree84c48c142192aafa0090b7f5f8d20eeb006b118c
parent16e33851c30eee0ba1374946194ddd6fc3f12763 (diff)
downloadlinux-21b7af43f19af983a35b7c543805ece7bc3ac04f.tar.gz
linux-21b7af43f19af983a35b7c543805ece7bc3ac04f.tar.bz2
linux-21b7af43f19af983a35b7c543805ece7bc3ac04f.zip
smb: client: fix cifs_pick_channel when channel needs reconnect
commit 79280191c2fd7f24899bbd640003b5389d3c109c upstream. 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@vger.kernel.org Reviewed-by: Shyam Prasad N <sprasad@microsoft.com> Signed-off-by: Henrique Carvalho <henrique.carvalho@suse.com> Signed-off-by: Steve French <stfrench@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--fs/smb/client/transport.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/smb/client/transport.c b/fs/smb/client/transport.c
index 691c9265994f..a77e5a489b1c 100644
--- a/fs/smb/client/transport.c
+++ b/fs/smb/client/transport.c
@@ -1050,7 +1050,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;
/*