Skip to content

Commit 268b8b5

Browse files
sprasad-microsoftsmfrench
authored andcommitted
cifs: pick channel for tcon and tdis
Today, the tree connect and disconnect requests are sent on the primary channel only. However, the new multichannel logic allows the session to remain active even if one of the channels are alive. So a tree connect can now be triggered during a reconnect on any of its channels. This change changes tcon and tdis calls to pick an active channel instead of the first one. Signed-off-by: Shyam Prasad N <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 936eba9 commit 268b8b5

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

fs/smb/client/smb2pdu.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1958,10 +1958,7 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree,
19581958
__le16 *unc_path = NULL;
19591959
int flags = 0;
19601960
unsigned int total_len;
1961-
struct TCP_Server_Info *server;
1962-
1963-
/* always use master channel */
1964-
server = ses->server;
1961+
struct TCP_Server_Info *server = cifs_pick_channel(ses);
19651962

19661963
cifs_dbg(FYI, "TCON\n");
19671964

@@ -2094,6 +2091,7 @@ SMB2_tdis(const unsigned int xid, struct cifs_tcon *tcon)
20942091
struct smb2_tree_disconnect_req *req; /* response is trivial */
20952092
int rc = 0;
20962093
struct cifs_ses *ses = tcon->ses;
2094+
struct TCP_Server_Info *server = cifs_pick_channel(ses);
20972095
int flags = 0;
20982096
unsigned int total_len;
20992097
struct kvec iov[1];
@@ -2116,7 +2114,7 @@ SMB2_tdis(const unsigned int xid, struct cifs_tcon *tcon)
21162114

21172115
invalidate_all_cached_dirs(tcon);
21182116

2119-
rc = smb2_plain_req_init(SMB2_TREE_DISCONNECT, tcon, ses->server,
2117+
rc = smb2_plain_req_init(SMB2_TREE_DISCONNECT, tcon, server,
21202118
(void **) &req,
21212119
&total_len);
21222120
if (rc)
@@ -2134,7 +2132,7 @@ SMB2_tdis(const unsigned int xid, struct cifs_tcon *tcon)
21342132
rqst.rq_iov = iov;
21352133
rqst.rq_nvec = 1;
21362134

2137-
rc = cifs_send_recv(xid, ses, ses->server,
2135+
rc = cifs_send_recv(xid, ses, server,
21382136
&rqst, &resp_buf_type, flags, &rsp_iov);
21392137
cifs_small_buf_release(req);
21402138
if (rc) {

0 commit comments

Comments
 (0)