Skip to content

Commit b9ad6b5

Browse files
sprasad-microsoftSteve French
authored andcommitted
cifs: nosharesock should be set on new server
Recent fix to maintain a nosharesock state on the server struct caused a regression. It updated this field in the old tcp session, and not the new one. This caused the multichannel scenario to misbehave. Fixes: c9f1c19 (cifs: nosharesock should not share socket with future sessions) Signed-off-by: Shyam Prasad N <[email protected]> Reviewed-by: Paulo Alcantara (SUSE) <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 1360572 commit b9ad6b5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

fs/cifs/connect.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,10 +1271,8 @@ static int match_server(struct TCP_Server_Info *server, struct smb3_fs_context *
12711271
{
12721272
struct sockaddr *addr = (struct sockaddr *)&ctx->dstaddr;
12731273

1274-
if (ctx->nosharesock) {
1275-
server->nosharesock = true;
1274+
if (ctx->nosharesock)
12761275
return 0;
1277-
}
12781276

12791277
/* this server does not share socket */
12801278
if (server->nosharesock)
@@ -1438,6 +1436,9 @@ cifs_get_tcp_session(struct smb3_fs_context *ctx,
14381436
goto out_err;
14391437
}
14401438

1439+
if (ctx->nosharesock)
1440+
tcp_ses->nosharesock = true;
1441+
14411442
tcp_ses->ops = ctx->ops;
14421443
tcp_ses->vals = ctx->vals;
14431444
cifs_set_net_ns(tcp_ses, get_net(current->nsproxy->net_ns));

0 commit comments

Comments
 (0)