summaryrefslogtreecommitdiff
path: root/fs/smb/client
diff options
context:
space:
mode:
authorShyam Prasad N <sprasad@microsoft.com>2024-01-21 03:32:43 +0000
committerSteve French <stfrench@microsoft.com>2024-01-23 19:03:46 -0600
commitfc43a8ac396d302ced1e991e4913827cf72c8eb9 (patch)
treeef4bb43fff68297be3fd0018817f428cf2f8c14b /fs/smb/client
parent966cc171c8be4fbeae1bf166d264e0bfb09e141c (diff)
cifs: cifs_pick_channel should try selecting active channels
cifs_pick_channel today just selects a channel based on the policy of least loaded channel. However, it does not take into account if the channel needs reconnect. As a result, we can have failures in send that can be completely avoided. This change doesn't make a channel a candidate for this selection if it needs reconnect. Signed-off-by: Shyam Prasad N <sprasad@microsoft.com> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/smb/client')
-rw-r--r--fs/smb/client/transport.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/smb/client/transport.c b/fs/smb/client/transport.c
index 4f717ad7c21b..8695c9961f5a 100644
--- a/fs/smb/client/transport.c
+++ b/fs/smb/client/transport.c
@@ -1026,6 +1026,9 @@ struct TCP_Server_Info *cifs_pick_channel(struct cifs_ses *ses)
if (!server || server->terminate)
continue;
+ if (CIFS_CHAN_NEEDS_RECONNECT(ses, i))
+ continue;
+
/*
* strictly speaking, we should pick up req_lock to read
* server->in_flight. But it shouldn't matter much here if we