diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2008-04-15 03:49:04 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-04-15 03:49:04 -0400 |
commit | 0517deed78be9cc9ce9799bf15da58fd0d2078bb (patch) | |
tree | 03b831f70096f99162a8cb26a55e01b64cd97926 | |
parent | 56690c2151d33534f0537fd03c533eda81d96f0f (diff) |
netconsole: only set CON_PRINTBUFFER if the user specifies a netconsole
Since 0bcc1816188e570bde1d56a208996660f2633ae0 (netconsole: Support
dynamic reconfiguration using configfs), the netconsole is always
registered, regardless of whether the user actually specified a
netconsole configuration on the command line.
However because netconsole has CON_PRINTBUFFER set, when it is
registered it causes the printk buffer to be replayed to all consoles.
When there is no netconsole configured this is a) pointless, and b)
somewhat annoying for the user of the existing console.
So instead we should only set CON_PRINTBUFFER if there is a netconsole
configuration found on the command line. This retains the existing
behaviour if a netconsole is setup by the user, and avoids spamming
other consoles when we're only registering for the dynamic
netconsole case.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/netconsole.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c index 501e451be911..665341e43055 100644 --- a/drivers/net/netconsole.c +++ b/drivers/net/netconsole.c | |||
@@ -730,7 +730,7 @@ static void write_msg(struct console *con, const char *msg, unsigned int len) | |||
730 | 730 | ||
731 | static struct console netconsole = { | 731 | static struct console netconsole = { |
732 | .name = "netcon", | 732 | .name = "netcon", |
733 | .flags = CON_ENABLED | CON_PRINTBUFFER, | 733 | .flags = CON_ENABLED, |
734 | .write = write_msg, | 734 | .write = write_msg, |
735 | }; | 735 | }; |
736 | 736 | ||
@@ -749,6 +749,9 @@ static int __init init_netconsole(void) | |||
749 | err = PTR_ERR(nt); | 749 | err = PTR_ERR(nt); |
750 | goto fail; | 750 | goto fail; |
751 | } | 751 | } |
752 | /* Dump existing printks when we register */ | ||
753 | netconsole.flags |= CON_PRINTBUFFER; | ||
754 | |||
752 | spin_lock_irqsave(&target_list_lock, flags); | 755 | spin_lock_irqsave(&target_list_lock, flags); |
753 | list_add(&nt->list, &target_list); | 756 | list_add(&nt->list, &target_list); |
754 | spin_unlock_irqrestore(&target_list_lock, flags); | 757 | spin_unlock_irqrestore(&target_list_lock, flags); |