Question: How to configure CIFS debug option in Linux servers to provide additional debug information in the client system logs?
1. Take backup of existing debug or to check the default value:
# cp /sys/kernel/debug/dynamic_debug/control /root/backup # cat /proc/fs/cifs/cifsFYI # cat /proc/fs/cifs/traceSMB
2. Enable debug chosen options:
# echo 'module cifs +p' > /sys/kernel/debug/dynamic_debug/control # echo 7 > /proc/fs/cifs/cifsFYI # echo 1 >/proc/fs/cifs/traceSMB # dmesg -c (Clear the message log)
3. To disable:
# echo "module cifs -p" >/sys/kernel/debug/dynamic_debug/control # echo 0 > /proc/fs/cifs/cifsFYI # echo 0 > /proc/fs/cifs/traceSMB
How to troubleshoot
1. Start the tcpdump capture.
2. Reproduce the issue.
3. Collect the tcpdump to review.
4. Review debug information in /var/log/dmesg or /var/log/messages system logs.
Example for tcpdump capture
# tcpdump -n -vv -s 0 -i {interface} -w /tmp/cifs_not_working.cap host {IP-Of-Windows}'
Note: Depending on the issue we may need to add extra debug options to tcpdump collection or we may need to collect from both ends of the network simultaneously.