Linux CIFS filesystem development
 help / color / mirror / Atom feed
From: Ross Lagerwall <ross.lagerwall@citrix.com>
To: <linux-cifs@vger.kernel.org>
Subject: Failure to reconnect after cluster failvoer
Date: Thu, 21 Feb 2019 16:57:48 +0000	[thread overview]
Message-ID: <70e91b0b-4bca-60ea-19cf-3df0f49d4e5a@citrix.com> (raw)

Hi,

I have an issue with SMB cluster failover. There are two Windows 2012 R2
Datacenter servers in the cluster. If the primary server is turned off,
then the secondary server becomes the primary. However, when this
happens the kernel client is not able to recover the mount.

Here is the reconnection network trace:

Time      Source       Destination  Protocol Length Info
16.640530 10.71.217.53 10.71.217.50 SMB2     172    Negotiate Protocol 
Request
16.641723 10.71.217.50 10.71.217.53 SMB2     318    Negotiate Protocol 
Response
16.641799 10.71.217.53 10.71.217.50 SMB2     190    Session Setup 
Request, NTLMSSP_NEGOTIATE
16.642148 10.71.217.50 10.71.217.53 SMB2     442    Session Setup 
Response, Error: STATUS_MORE_PROCESSING_REQUIRED, NTLMSSP_CHALLENGE
16.642201 10.71.217.53 10.71.217.50 SMB2     562    Session Setup 
Request, NTLMSSP_AUTH, User: clusterad.local7337\Administrator
16.656407 10.71.217.50 10.71.217.53 SMB2     142    Session Setup Response
16.656492 10.71.217.53 10.71.217.50 SMB2     190    Tree Connect Request 
Tree: \\10.71.217.50\smbshare
16.656916 10.71.217.50 10.71.217.53 SMB2     143    Tree Connect 
Response, Error: STATUS_BAD_NETWORK_NAME
16.659249 10.71.217.53 10.71.217.50 SMB2     190    Tree Connect Request 
Tree: \\10.71.217.50\smbshare
16.659635 10.71.217.50 10.71.217.53 SMB2     143    Tree Connect 
Response, Error: STATUS_BAD_NETWORK_NAME
20.224591 10.71.217.53 10.71.217.50 SMB2     182    Tree Connect Request 
Tree: \\10.71.217.50\IPC$
20.225344 10.71.217.50 10.71.217.53 SMB2     150    Tree Connect Response
20.225449 10.71.217.53 10.71.217.50 SMB2     216    Ioctl Request 
FSCTL_VALIDATE_NEGOTIATE_INFO
20.225934 10.71.217.50 10.71.217.53 SMB2     206    Ioctl Response 
FSCTL_VALIDATE_NEGOTIATE_INFO
20.225975 10.71.217.53 10.71.217.50 SMB2     190    Tree Connect Request 
Tree: \\10.71.217.50\smbshare
20.226355 10.71.217.50 10.71.217.53 SMB2     143    Tree Connect 
Response, Error: STATUS_BAD_NETWORK_NAME
22.240595 10.71.217.53 10.71.217.50 SMB2     190    Tree Connect Request 
Tree: \\10.71.217.50\smbshare
22.241159 10.71.217.50 10.71.217.53 SMB2     143    Tree Connect 
Response, Error: STATUS_BAD_NETWORK_NAME
24.256590 10.71.217.53 10.71.217.50 SMB2     190    Tree Connect Request 
Tree: \\10.71.217.50\smbshare
24.257380 10.71.217.50 10.71.217.53 SMB2     143    Tree Connect 
Response, Error: STATUS_BAD_NETWORK_NAME
...
40.384609 10.71.217.53 10.71.217.50 SMB2     190    Tree Connect Request 
Tree: \\10.71.217.50\smbshare
40.385135 10.71.217.50 10.71.217.53 SMB2     143    Tree Connect 
Response, Error: STATUS_BAD_NETWORK_NAME
41.772006 10.71.217.53 10.71.217.50 SMB2     190    Tree Connect Request 
Tree: \\10.71.217.50\smbshare
41.772562 10.71.217.50 10.71.217.53 SMB2     143    Tree Connect 
Response, Error: STATUS_NETWORK_NAME_DELETED
41.772641 10.71.217.53 10.71.217.50 SMB2     190    Tree Connect Request 
Tree: \\10.71.217.50\smbshare
41.773037 10.71.217.50 10.71.217.53 SMB2     143    Tree Connect 
Response, Error: STATUS_NETWORK_NAME_DELETED
42.400589 10.71.217.53 10.71.217.50 SMB2     190    Tree Connect Request 
Tree: \\10.71.217.50\smbshare
...

After the secondary server takes over (presumably once it stops
returning STATUS_BAD_NETWORK_NAME), it then returns
STATUS_NETWORK_NAME_DELETED indefinitely.

This can be fixed by delaying the tree connect to IPC$ until after the
tree connect to the share succeeds.  The server then no longer returns
STATUS_NETWORK_NAME_DELETED and instead responds successfully.  I'm not
sure why the server behaves like this and I'm not sure if the client is
doing something wrong. I found this out because it used to work on older
kernels before b327a717e506 ("CIFS: make IPC a regular tcon").

Here is the patch that makes it work:

diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index dba986524917..1f97ed6459bf 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -2864,7 +2864,14 @@ void smb2_reconnect_server(struct work_struct *work)

  	spin_unlock(&cifs_tcp_ses_lock);

+	rc = 0;
  	list_for_each_entry_safe(tcon, tcon2, &tmp_list, rlist) {
+		if (rc) {
+			list_del_init(&tcon->rlist);
+			cifs_put_tcon(tcon);
+			continue;
+		}
+
  		rc = smb2_reconnect(SMB2_INTERNAL_CMD, tcon);
  		if (!rc)
  			cifs_reopen_persistent_handles(tcon);

Can anyone give any more info on this oddity and whether this is a 
useful patch?

Thanks,
-- 
Ross Lagerwall

             reply	other threads:[~2019-02-21 16:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-21 16:57 Ross Lagerwall [this message]
2019-02-21 17:06 ` Failure to reconnect after cluster failvoer Steve French
2019-02-21 17:59   ` Tom Talpey
2019-02-22 17:16     ` Ross Lagerwall
2019-02-22 23:25       ` Tom Talpey
2019-02-25 13:13         ` Ross Lagerwall
2019-02-27 14:16           ` Tom Talpey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=70e91b0b-4bca-60ea-19cf-3df0f49d4e5a@citrix.com \
    --to=ross.lagerwall@citrix.com \
    --cc=linux-cifs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox