summaryrefslogtreecommitdiff
path: root/fs/cifs
diff options
context:
space:
mode:
authorShyam Prasad N <sprasad@microsoft.com>2021-11-21 19:45:44 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-12-01 11:04:56 +0300
commitd841c6720fb24dda402d3fcc08eda6ad4efa457c (patch)
tree6aeae243159b57e87acf397a02ddbad1a04f84ac /fs/cifs
parentc9c8c054a01ca6259cd380641cd21bfce791d124 (diff)
downloadlinux-d841c6720fb24dda402d3fcc08eda6ad4efa457c.tar.xz
cifs: nosharesock should be set on new server
commit b9ad6b5b687e798746024e5fc4574d8fa8bdfade 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: c9f1c19cf7c5 (cifs: nosharesock should not share socket with future sessions) Signed-off-by: Shyam Prasad N <sprasad@microsoft.com> Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz> Signed-off-by: Steve French <stfrench@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/connect.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index d26703a05c6b..439f02f1886c 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -1217,10 +1217,8 @@ static int match_server(struct TCP_Server_Info *server, struct smb3_fs_context *
{
struct sockaddr *addr = (struct sockaddr *)&ctx->dstaddr;
- if (ctx->nosharesock) {
- server->nosharesock = true;
+ if (ctx->nosharesock)
return 0;
- }
/* this server does not share socket */
if (server->nosharesock)
@@ -1376,6 +1374,9 @@ cifs_get_tcp_session(struct smb3_fs_context *ctx)
goto out_err;
}
+ if (ctx->nosharesock)
+ tcp_ses->nosharesock = true;
+
tcp_ses->ops = ctx->ops;
tcp_ses->vals = ctx->vals;
cifs_set_net_ns(tcp_ses, get_net(current->nsproxy->net_ns));