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

net: vlan: suppress "failed to kill vid" warnings

When a real dev unregisters, vlan_device_event() also unregisters all
of its vlan interfaces. For each VID this ends up in __vlan_vid_del(),
which attempts to remove the VID from the real dev's VLAN filter.

But the unregistering real dev might no longer be able to issue the
required IOs, and return an error. Subsequently we raise a noisy warning
msg that is not appropriate for this situation: the real dev is being
torn down anyway, there shouldn't be any worry about cleanly releasing
all of its HW-internal resources.

So to avoid scaring innocent users, suppress this warning when the
failed deletion happens on an unregistering device.
While at it also convert the raw pr_warn() to a more fitting
netdev_warn().

Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Julian Wiedmann and committed by
David S. Miller
bd706ff8 3e07df43

+2 -3
+2 -3
net/8021q/vlan_core.c
··· 359 359 int err; 360 360 361 361 err = vlan_kill_rx_filter_info(dev, proto, vid); 362 - if (err) 363 - pr_warn("failed to kill vid %04x/%d for device %s\n", 364 - proto, vid, dev->name); 362 + if (err && dev->reg_state != NETREG_UNREGISTERING) 363 + netdev_warn(dev, "failed to kill vid %04x/%d\n", proto, vid); 365 364 366 365 list_del(&vid_info->list); 367 366 kfree(vid_info);