Skip to content

Commit

Permalink
cifs: cifs_pick_channel should try selecting active channels
Browse files Browse the repository at this point in the history
[ Upstream commit fc43a8a ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
sprasad-microsoft authored and gregkh committed Mar 1, 2024
1 parent 8fbefa7 commit 59e04d3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fs/smb/client/transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 59e04d3

Please sign in to comment.