Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

SMB3: Log at least once if tree connect fails during reconnect

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>

+7 -2
+3 -1
fs/cifs/cifssmb.c
··· 206 206 mutex_unlock(&ses->session_mutex); 207 207 cifs_dbg(FYI, "reconnect tcon rc = %d\n", rc); 208 208 209 - if (rc) 209 + if (rc) { 210 + printk_once(KERN_WARNING "reconnect tcon failed rc = %d\n", rc); 210 211 goto out; 212 + } 211 213 212 214 atomic_inc(&tconInfoReconnectCount); 213 215
+4 -1
fs/cifs/smb2pdu.c
··· 268 268 mutex_unlock(&tcon->ses->session_mutex); 269 269 270 270 cifs_dbg(FYI, "reconnect tcon rc = %d\n", rc); 271 - if (rc) 271 + if (rc) { 272 + /* If sess reconnected but tcon didn't, something strange ... */ 273 + printk_once(KERN_WARNING "reconnect tcon failed rc = %d\n", rc); 272 274 goto out; 275 + } 273 276 274 277 if (smb2_command != SMB2_INTERNAL_CMD) 275 278 queue_delayed_work(cifsiod_wq, &server->reconnect, 0);