netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* spurious netconsole: network logging stopped messages
@ 2011-01-03 16:57 Ferenc Wagner
  2011-01-06 15:11 ` [PATCH 0/2] " Ferenc Wagner
  0 siblings, 1 reply; 5+ messages in thread
From: Ferenc Wagner @ 2011-01-03 16:57 UTC (permalink / raw)
  To: netdev

[-- Attachment #1: Type: text/plain, Size: 816 bytes --]

Hi,

In a running system, I can load the netconsole module, and gather the
messages on the other side all right. Now if I modprobe dummy and rmmod
dummy, the following message gets logged (via netconsole as well):

netconsole: network logging stopped, interface dummy0 unregistered

although I never asked netconsole to log through dummy0. The problem is
fairly obvious in netconsole_netdev_event() and could probably be fixed
with something like the first attached patch.  I didn't even compile
tested it, though, because the second attached patch made me realise
that I don't quite understand the bridge logic here.  Why should
netconsole stop logging through a bridge device if that loses a slave?
Or do I misunderstand the meaning of NETDEV_BONDING_DESLAVE?

Please Cc me, I'm not subscribed.
-- 
Thanks,
Feri.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-netconsole-don-t-announce-stopping-if-nothing-happen.patch --]
[-- Type: text/x-diff, Size: 1568 bytes --]

>From b324e4425f47fcde54757c134a7fdd98f3dc9521 Mon Sep 17 00:00:00 2001
Message-Id: <b324e4425f47fcde54757c134a7fdd98f3dc9521.1294073227.git.wferi@niif.hu>
From: Ferenc Wagner <wferi@niif.hu>
Date: Mon, 3 Jan 2011 17:34:55 +0100
Subject: [PATCH 1/2] netconsole: don't announce stopping if nothing happened


Signed-off-by: Ferenc Wagner <wferi@niif.hu>
---
 drivers/net/netconsole.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index 94255f0..b2ad998 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -664,6 +664,7 @@ static int netconsole_netdev_event(struct notifier_block *this,
 	unsigned long flags;
 	struct netconsole_target *nt;
 	struct net_device *dev = ptr;
+	bool stopped = false;
 
 	if (!(event == NETDEV_CHANGENAME || event == NETDEV_UNREGISTER ||
 	      event == NETDEV_BONDING_DESLAVE || event == NETDEV_GOING_DOWN))
@@ -690,13 +691,14 @@ static int netconsole_netdev_event(struct notifier_block *this,
 			case NETDEV_GOING_DOWN:
 			case NETDEV_BONDING_DESLAVE:
 				nt->enabled = 0;
+				stopped = true;
 				break;
 			}
 		}
 		netconsole_target_put(nt);
 	}
 	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, "
 			"interface %s %s\n",  dev->name,
 			event == NETDEV_UNREGISTER ? "unregistered" : "released slaves");
-- 
1.6.5


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-netconsole-clarify-stopping-message.patch --]
[-- Type: text/x-diff, Size: 1267 bytes --]

>From 211feede3c64419e6997e62a60f4c3c70f237ef8 Mon Sep 17 00:00:00 2001
Message-Id: <211feede3c64419e6997e62a60f4c3c70f237ef8.1294073227.git.wferi@niif.hu>
In-Reply-To: <b324e4425f47fcde54757c134a7fdd98f3dc9521.1294073227.git.wferi@niif.hu>
References: <b324e4425f47fcde54757c134a7fdd98f3dc9521.1294073227.git.wferi@niif.hu>
From: Ferenc Wagner <wferi@niif.hu>
Date: Mon, 3 Jan 2011 17:44:25 +0100
Subject: [PATCH 2/2] netconsole: clarify stopping message


Signed-off-by: Ferenc Wagner <wferi@niif.hu>
---
 drivers/net/netconsole.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index b2ad998..dfb67eb 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -699,8 +699,8 @@ static int netconsole_netdev_event(struct notifier_block *this,
 	}
 	spin_unlock_irqrestore(&target_list_lock, flags);
 	if (stopped && (event == NETDEV_UNREGISTER || event == NETDEV_BONDING_DESLAVE))
-		printk(KERN_INFO "netconsole: network logging stopped, "
-			"interface %s %s\n",  dev->name,
+		printk(KERN_INFO "netconsole: network logging stopped on "
+			"interface %s as it %s\n",  dev->name,
 			event == NETDEV_UNREGISTER ? "unregistered" : "released slaves");
 
 done:
-- 
1.6.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 0/2] Re: spurious netconsole: network logging stopped messages
  2011-01-03 16:57 spurious netconsole: network logging stopped messages Ferenc Wagner
@ 2011-01-06 15:11 ` Ferenc Wagner
  2011-01-06 15:11   ` [PATCH 1/2] netconsole: don't announce stopping if nothing happened Ferenc Wagner
                     ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Ferenc Wagner @ 2011-01-06 15:11 UTC (permalink / raw)
  To: netdev; +Cc: Ferenc Wagner

Hi,

I've been running with these two patches for a couple of days now.
I don't understand the bridge case: why should netconsole stop logging
on a bridge device which lost a slave?  Or does NETDEV_BONDING_DESLAVE
mean something else?

Anyway, I think the first patch fixes a real bug and the second makes
the kernel message clearer, independently of its cause.

Regards,
Feri.

Ferenc Wagner (2):
  netconsole: don't announce stopping if nothing happened
  netconsole: clarify stopping message

 drivers/net/netconsole.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] netconsole: don't announce stopping if nothing happened
  2011-01-06 15:11 ` [PATCH 0/2] " Ferenc Wagner
@ 2011-01-06 15:11   ` Ferenc Wagner
  2011-01-06 15:11   ` [PATCH 2/2] netconsole: clarify stopping message Ferenc Wagner
  2011-01-06 19:30   ` [PATCH 0/2] Re: spurious netconsole: network logging stopped messages David Miller
  2 siblings, 0 replies; 5+ messages in thread
From: Ferenc Wagner @ 2011-01-06 15:11 UTC (permalink / raw)
  To: netdev; +Cc: Ferenc Wagner


Signed-off-by: Ferenc Wagner <wferi@niif.hu>
---
 drivers/net/netconsole.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index 94255f0..b2ad998 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -664,6 +664,7 @@ static int netconsole_netdev_event(struct notifier_block *this,
 	unsigned long flags;
 	struct netconsole_target *nt;
 	struct net_device *dev = ptr;
+	bool stopped = false;
 
 	if (!(event == NETDEV_CHANGENAME || event == NETDEV_UNREGISTER ||
 	      event == NETDEV_BONDING_DESLAVE || event == NETDEV_GOING_DOWN))
@@ -690,13 +691,14 @@ static int netconsole_netdev_event(struct notifier_block *this,
 			case NETDEV_GOING_DOWN:
 			case NETDEV_BONDING_DESLAVE:
 				nt->enabled = 0;
+				stopped = true;
 				break;
 			}
 		}
 		netconsole_target_put(nt);
 	}
 	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, "
 			"interface %s %s\n",  dev->name,
 			event == NETDEV_UNREGISTER ? "unregistered" : "released slaves");
-- 
1.6.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] netconsole: clarify stopping message
  2011-01-06 15:11 ` [PATCH 0/2] " Ferenc Wagner
  2011-01-06 15:11   ` [PATCH 1/2] netconsole: don't announce stopping if nothing happened Ferenc Wagner
@ 2011-01-06 15:11   ` Ferenc Wagner
  2011-01-06 19:30   ` [PATCH 0/2] Re: spurious netconsole: network logging stopped messages David Miller
  2 siblings, 0 replies; 5+ messages in thread
From: Ferenc Wagner @ 2011-01-06 15:11 UTC (permalink / raw)
  To: netdev; +Cc: Ferenc Wagner


Signed-off-by: Ferenc Wagner <wferi@niif.hu>
---
 drivers/net/netconsole.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index b2ad998..dfb67eb 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -699,8 +699,8 @@ static int netconsole_netdev_event(struct notifier_block *this,
 	}
 	spin_unlock_irqrestore(&target_list_lock, flags);
 	if (stopped && (event == NETDEV_UNREGISTER || event == NETDEV_BONDING_DESLAVE))
-		printk(KERN_INFO "netconsole: network logging stopped, "
-			"interface %s %s\n",  dev->name,
+		printk(KERN_INFO "netconsole: network logging stopped on "
+			"interface %s as it %s\n",  dev->name,
 			event == NETDEV_UNREGISTER ? "unregistered" : "released slaves");
 
 done:
-- 
1.6.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/2] Re: spurious netconsole: network logging stopped messages
  2011-01-06 15:11 ` [PATCH 0/2] " Ferenc Wagner
  2011-01-06 15:11   ` [PATCH 1/2] netconsole: don't announce stopping if nothing happened Ferenc Wagner
  2011-01-06 15:11   ` [PATCH 2/2] netconsole: clarify stopping message Ferenc Wagner
@ 2011-01-06 19:30   ` David Miller
  2 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2011-01-06 19:30 UTC (permalink / raw)
  To: wferi; +Cc: netdev

From: Ferenc Wagner <wferi@niif.hu>
Date: Thu,  6 Jan 2011 16:11:18 +0100

> Hi,
> 
> I've been running with these two patches for a couple of days now.
> I don't understand the bridge case: why should netconsole stop logging
> on a bridge device which lost a slave?  Or does NETDEV_BONDING_DESLAVE
> mean something else?
> 
> Anyway, I think the first patch fixes a real bug and the second makes
> the kernel message clearer, independently of its cause.

Both applied, thank you.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-01-06 19:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-03 16:57 spurious netconsole: network logging stopped messages Ferenc Wagner
2011-01-06 15:11 ` [PATCH 0/2] " Ferenc Wagner
2011-01-06 15:11   ` [PATCH 1/2] netconsole: don't announce stopping if nothing happened Ferenc Wagner
2011-01-06 15:11   ` [PATCH 2/2] netconsole: clarify stopping message Ferenc Wagner
2011-01-06 19:30   ` [PATCH 0/2] Re: spurious netconsole: network logging stopped messages David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).