All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][SMB3 cient] fix error connecting to channels (negprot failure)
@ 2022-06-19 18:38 Steve French
  2022-06-20  6:13 ` Shyam Prasad N
  0 siblings, 1 reply; 2+ messages in thread
From: Steve French @ 2022-06-19 18:38 UTC (permalink / raw)
  To: CIFS; +Cc: Shyam Prasad N

[-- Attachment #1: Type: text/plain, Size: 328 bytes --]

smb3: fix empty netname context on secondary channels

Some servers do not allow null netname contexts, which would cause
multichannel to revert to single channel when mounting to some
servers (e.g. Azure xSMB).

Fixes: 4c14d7043fede ("cifs: populate empty hostnames for extra channels")

See attached patch

-- 
Thanks,

Steve

[-- Attachment #2: 0001-smb3-fix-empty-netname-context-on-secondary-channels.patch --]
[-- Type: text/x-patch, Size: 1672 bytes --]

From 8298f38ce0b95f9a3b5f7d83dbeb7a32c75540cb Mon Sep 17 00:00:00 2001
From: Steve French <stfrench@microsoft.com>
Date: Sat, 18 Jun 2022 17:24:23 -0500
Subject: [PATCH] smb3: fix empty netname context on secondary channels

Some servers do not allow null netname contexts, which would cause
multichannel to revert to single channel when mounting to some
servers (e.g. Azure xSMB).

Fixes: 4c14d7043fede ("cifs: populate empty hostnames for extra channels")
Signed-off-by: Steve French <stfrench@microsoft.com>
---
 fs/cifs/smb2pdu.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index b515140bad8d..5e8c4737b183 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -570,16 +570,18 @@ assemble_neg_contexts(struct smb2_negotiate_req *req,
 	*total_len += ctxt_len;
 	pneg_ctxt += ctxt_len;
 
-	ctxt_len = build_netname_ctxt((struct smb2_netname_neg_context *)pneg_ctxt,
-					server->hostname);
-	*total_len += ctxt_len;
-	pneg_ctxt += ctxt_len;
-
 	build_posix_ctxt((struct smb2_posix_neg_context *)pneg_ctxt);
 	*total_len += sizeof(struct smb2_posix_neg_context);
 	pneg_ctxt += sizeof(struct smb2_posix_neg_context);
 
-	neg_context_count = 4;
+	if (server->hostname && (server->hostname[0] != 0)) {
+		ctxt_len = build_netname_ctxt((struct smb2_netname_neg_context *)pneg_ctxt,
+					server->hostname);
+		*total_len += ctxt_len;
+		pneg_ctxt += ctxt_len;
+		neg_context_count = 4;
+	} else /* second channels do not have a hostname */
+		neg_context_count = 3;
 
 	if (server->compress_algorithm) {
 		build_compression_ctxt((struct smb2_compression_capabilities_context *)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH][SMB3 cient] fix error connecting to channels (negprot failure)
  2022-06-19 18:38 [PATCH][SMB3 cient] fix error connecting to channels (negprot failure) Steve French
@ 2022-06-20  6:13 ` Shyam Prasad N
  0 siblings, 0 replies; 2+ messages in thread
From: Shyam Prasad N @ 2022-06-20  6:13 UTC (permalink / raw)
  To: Steve French; +Cc: CIFS

On Mon, Jun 20, 2022 at 12:08 AM Steve French <smfrench@gmail.com> wrote:
>
> smb3: fix empty netname context on secondary channels
>
> Some servers do not allow null netname contexts, which would cause
> multichannel to revert to single channel when mounting to some
> servers (e.g. Azure xSMB).
>
> Fixes: 4c14d7043fede ("cifs: populate empty hostnames for extra channels")
>
> See attached patch
>
> --
> Thanks,
>
> Steve

Hi Steve,

Thanks for handling this when I was away.

Regarding the change, it looks good to me.
Reviewed-by: Shyam Prasad N <sprasad@microsoft.com>

Was this the cause for failure of cifs/104 test in buildbot?
Is that test passing after this change?

-- 
Regards,
Shyam

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-20  6:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-19 18:38 [PATCH][SMB3 cient] fix error connecting to channels (negprot failure) Steve French
2022-06-20  6:13 ` Shyam Prasad N

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.