Skip to content

Commit d841c67

Browse files
sprasad-microsoftgregkh
authored andcommitted
cifs: nosharesock should be set on new server
commit b9ad6b5 upstream. 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]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent c9c8c05 commit d841c67

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
@@ -1217,10 +1217,8 @@ static int match_server(struct TCP_Server_Info *server, struct smb3_fs_context *
12171217
{
12181218
struct sockaddr *addr = (struct sockaddr *)&ctx->dstaddr;
12191219

1220-
if (ctx->nosharesock) {
1221-
server->nosharesock = true;
1220+
if (ctx->nosharesock)
12221221
return 0;
1223-
}
12241222

12251223
/* this server does not share socket */
12261224
if (server->nosharesock)
@@ -1376,6 +1374,9 @@ cifs_get_tcp_session(struct smb3_fs_context *ctx)
13761374
goto out_err;
13771375
}
13781376

1377+
if (ctx->nosharesock)
1378+
tcp_ses->nosharesock = true;
1379+
13791380
tcp_ses->ops = ctx->ops;
13801381
tcp_ses->vals = ctx->vals;
13811382
cifs_set_net_ns(tcp_ses, get_net(current->nsproxy->net_ns));

0 commit comments

Comments
 (0)