Commit 141dfba3 authored by Ferenc Wagner's avatar Ferenc Wagner Committed by David S. Miller

netconsole: don't announce stopping if nothing happened

Signed-off-by: default avatarFerenc Wagner <wferi@niif.hu>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 68d7c1aa
...@@ -664,6 +664,7 @@ static int netconsole_netdev_event(struct notifier_block *this, ...@@ -664,6 +664,7 @@ static int netconsole_netdev_event(struct notifier_block *this,
unsigned long flags; unsigned long flags;
struct netconsole_target *nt; struct netconsole_target *nt;
struct net_device *dev = ptr; struct net_device *dev = ptr;
bool stopped = false;
if (!(event == NETDEV_CHANGENAME || event == NETDEV_UNREGISTER || if (!(event == NETDEV_CHANGENAME || event == NETDEV_UNREGISTER ||
event == NETDEV_BONDING_DESLAVE || event == NETDEV_GOING_DOWN)) event == NETDEV_BONDING_DESLAVE || event == NETDEV_GOING_DOWN))
...@@ -690,13 +691,14 @@ static int netconsole_netdev_event(struct notifier_block *this, ...@@ -690,13 +691,14 @@ static int netconsole_netdev_event(struct notifier_block *this,
case NETDEV_GOING_DOWN: case NETDEV_GOING_DOWN:
case NETDEV_BONDING_DESLAVE: case NETDEV_BONDING_DESLAVE:
nt->enabled = 0; nt->enabled = 0;
stopped = true;
break; break;
} }
} }
netconsole_target_put(nt); netconsole_target_put(nt);
} }
spin_unlock_irqrestore(&target_list_lock, flags); spin_unlock_irqrestore(&target_list_lock, flags);
if (event == NETDEV_UNREGISTER || event == NETDEV_BONDING_DESLAVE) if (stopped && (event == NETDEV_UNREGISTER || event == NETDEV_BONDING_DESLAVE))
printk(KERN_INFO "netconsole: network logging stopped, " printk(KERN_INFO "netconsole: network logging stopped, "
"interface %s %s\n", dev->name, "interface %s %s\n", dev->name,
event == NETDEV_UNREGISTER ? "unregistered" : "released slaves"); event == NETDEV_UNREGISTER ? "unregistered" : "released slaves");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment