暂无个人介绍
kernel:unregister_netdevice: waiting for lo to become free. Usage count = 1
SOLUTION VERIFIED - Updated July 6 2017 at 10:42 AM - English
Environment
Red Hat Enterprise Linux 7.4 or earlier
TCP connection over loopback interface lo
Issue
kernel:unregister_netdevice: waiting for lo to become free. Usage count = 1
Above message is logged constantly on console or in dmesg or /var/log/messages file or in systemd journal
Resolution
Update to RHEL 7.5 when available.
Root Cause
A bug resulted in the loopback device having a reference count which was increased but never decreased.
This was resolved by upstream patch tcp: reset sk_rx_dst in tcp_disconnect() in Linux Kernel v4.12 and backported to RHEL 7.5 on Red Hat Private Bug 1467770.
Diagnostic Steps
Use the reproducer described at unregister_netdevice: waiting for lo to become free. Usage count = 1
Run it in a netns once and delete the netns:
Raw
make tcp-bug
ip netns add test1
ip netns exec test1 ip link set dev lo up
ip netns exec test1 ./tcp-bug
ip netns del test1
In the error condition kernel:unregister_netdevice: waiting for lo to become free. Usage count = 1 is printed on console and in dmesg.
In the working condition, no error is printed and the netns is successfully deleted.