Skip to content

Commit

Permalink
SMB3: Log at least once if tree connect fails during reconnect
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Steve French committed Apr 11, 2018
1 parent c0953f2 commit c318e6c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion fs/cifs/cifssmb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
5 changes: 4 additions & 1 deletion fs/cifs/smb2pdu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c318e6c

Please sign in to comment.