]> git.baikalelectronics.ru Git - kernel.git/commitdiff
cifs: nosharesock should be set on new server
authorShyam Prasad N <sprasad@microsoft.com>
Sun, 21 Nov 2021 16:45:44 +0000 (16:45 +0000)
committerSteve French <stfrench@microsoft.com>
Tue, 23 Nov 2021 16:04:49 +0000 (10:04 -0600)
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: 8f2e1caff41f (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>
fs/cifs/connect.c

index 67e4c5548e9d0d291de1b67e76c90aef8d7dd502..6b705026da1a37d238348e0fefe06f022913bfe9 100644 (file)
@@ -1271,10 +1271,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)
@@ -1438,6 +1436,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));