This is a note to let you know that I've just added the patch titled cifs: nosharesock should be set on new server to the 5.15-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: cifs-nosharesock-should-be-set-on-new-server.patch and it can be found in the queue-5.15 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From b9ad6b5b687e798746024e5fc4574d8fa8bdfade Mon Sep 17 00:00:00 2001 From: Shyam Prasad N <sprasad@xxxxxxxxxxxxx> Date: Sun, 21 Nov 2021 16:45:44 +0000 Subject: cifs: nosharesock should be set on new server From: Shyam Prasad N <sprasad@xxxxxxxxxxxxx> 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@xxxxxxxxxxxxx> Reviewed-by: Paulo Alcantara (SUSE) <pc@xxxxxx> Signed-off-by: Steve French <stfrench@xxxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/cifs/connect.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -1217,10 +1217,8 @@ static int match_server(struct TCP_Serve { 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_cont 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)); Patches currently in stable-queue which might be from sprasad@xxxxxxxxxxxxx are queue-5.15/cifs-nosharesock-should-be-set-on-new-server.patch queue-5.15/cifs-nosharesock-should-not-share-socket-with-future.patch