The following shows how you may enable additional debug logging on Linux for troubleshooting SMB related issues.
# modprobe cifs
# echo 'module cifs +p' > /sys/kernel/debug/dynamic_debug/control
# echo 'file fs/cifs/* +p' > /sys/kernel/debug/dynamic_debug/control
# echo 7 > /proc/fs/cifs/cifsFYI
Example log output:
# dmesg |tail -50
[75527.604137] CIFS: fs/cifs/connect.c: sndbuf 16384 rcvbuf 131072 rcvtimeo 0x1b58
[75527.606233] CIFS: fs/cifs/connect.c: cifs_get_tcp_session: next dns resolution scheduled for 600 seconds in the future
[75527.606246] CIFS: fs/cifs/connect.c: VFS: in cifs_get_smb_ses as Xid: 59 with uid: 0
[75527.606254] CIFS: fs/cifs/connect.c: Existing smb sess not found
[75527.606274] CIFS: fs/cifs/smb2pdu.c: Negotiate protocol
[75527.606298] CIFS: fs/cifs/transport.c: wait_for_free_credits: remove 1 credits total=0
[75527.606342] CIFS: fs/cifs/transport.c: Sending smb: smb_len=106
[75527.606530] CIFS: fs/cifs/connect.c: Demultiplex PID: 1177
[75527.606911] CIFS: fs/cifs/connect.c: RFC1002 header 0xe1
[75527.606940] CIFS: fs/cifs/smb2misc.c: SMB2 data length 97 offset 128
[75527.606949] CIFS: fs/cifs/smb2misc.c: SMB2 len 225
[75527.606963] CIFS: fs/cifs/smb2ops.c: smb2_add_credits: added 10 credits total=10
[75527.606976] CIFS: fs/cifs/transport.c: cifs_sync_mid_result: cmd=0 mid=0 state=4
[75527.606991] CIFS: fs/cifs/misc.c: Null buffer passed to cifs_small_buf_release
[75527.607001] CIFS: fs/cifs/smb2pdu.c: mode 0x1
[75527.607004] CIFS: fs/cifs/smb2pdu.c: negotiated smb3.0 dialect
[75527.607028] CIFS: fs/cifs/connect.c: Security Mode: 0x1 Capabilities: 0x300055 TimeAdjust: 0
[75527.607033] CIFS: fs/cifs/smb2pdu.c: Session Setup
[75527.607036] CIFS: fs/cifs/smb2pdu.c: sess setup type 3
[75527.607051] CIFS: fs/cifs/cifs_spnego.c: key description = ver=0x2;host=172.16.236.17;ip4=172.16.236.17;sec=krb5;uid=0x1388;creduid=0x0;user=bpatridge;pid=0x496
[75527.637196] CIFS: VFS: Verify user has a krb5 ticket and keyutils is installed
[75527.637225] CIFS: VFS: \\172.16.236.17 Send error in SessSetup = -126
[75527.637235] CIFS: fs/cifs/connect.c: VFS: leaving cifs_get_smb_ses (xid = 59) rc = -126
[75527.637245] CIFS: fs/cifs/dfs_cache.c: cache_refresh_path: search path: \172.16.236.17\tintri
[75527.637260] CIFS: fs/cifs/dfs_cache.c: get_dfs_referral: get an DFS referral for \172.16.236.17\tintri
[75527.637281] CIFS: fs/cifs/connect.c: VFS: leaving mount_put_conn