SMB3: Log at least once if tree connect fails during reconnect
authorSteve French <stfrench@microsoft.com>
Wed, 4 Apr 2018 19:08:52 +0000 (14:08 -0500)
committerSteve French <stfrench@microsoft.com>
Wed, 11 Apr 2018 21:44:58 +0000 (16:44 -0500)
Adding an extra debug message to show if a tree connect failure during
reconnect (and made it a log once so it doesn't spam the logs).
Saw a case recently where tree connect repeatedly returned
access denied on reconnect and it wasn't as easy to spot as it
should have been.

Signed-off-by: Steve French <smfrench@gmail.com>
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
fs/cifs/cifssmb.c
fs/cifs/smb2pdu.c

index 59c09a596c0a71b098c2d84a6d7597df09eb07a0..abdc93d4fee82c0509b5783d4d8ecca08095891b 100644 (file)
@@ -206,8 +206,10 @@ cifs_reconnect_tcon(struct cifs_tcon *tcon, int smb_command)
        mutex_unlock(&ses->session_mutex);
        cifs_dbg(FYI, "reconnect tcon rc = %d\n", rc);
 
-       if (rc)
+       if (rc) {
+               printk_once(KERN_WARNING "reconnect tcon failed rc = %d\n", rc);
                goto out;
+       }
 
        atomic_inc(&tconInfoReconnectCount);
 
index e5ac474d5d87c073419610714a1a94a3e48ef781..6c2910e6c984ebd4ccf707a87d3b86ae51a32d47 100644 (file)
@@ -268,8 +268,11 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon)
        mutex_unlock(&tcon->ses->session_mutex);
 
        cifs_dbg(FYI, "reconnect tcon rc = %d\n", rc);
-       if (rc)
+       if (rc) {
+               /* If sess reconnected but tcon didn't, something strange ... */
+               printk_once(KERN_WARNING "reconnect tcon failed rc = %d\n", rc);
                goto out;
+       }
 
        if (smb2_command != SMB2_INTERNAL_CMD)
                queue_delayed_work(cifsiod_wq, &server->reconnect, 0);