From: "Randy.Dunlap" <rddunlap@osdlab.org>
To: Crutcher Dunnavant <crutcher@datastacks.com>
Cc: lkml <linux-kernel@vger.kernel.org>
Subject: Re: Magic SysRq +# in 2.4.9-ac/2.4.10-pre12
Date: Fri, 21 Sep 2001 14:42:02 -0700 [thread overview]
Message-ID: <3BABB42A.6D17F44E@osdlab.org> (raw)
In-Reply-To: <3BA8C01D.79FBD7C3@osdlab.org> <20010921170828.J8188@mueller.datastacks.com>
Crutcher Dunnavant wrote:
>
> I'm looking real close at this right now, and there are a couple of
> problems, and a simple, but ugly solution.
>
> The entire reason that console_loglevel is touched _after_ the call to
> the second level handler is actually for the loglevel handler's
> printout. I was trying to minimize change in the display, but horked it.
>
> Here is the problem.
>
> SysRq events use action messages which get printed by the top level
> handler before calling the second level handler, the call line is:
>
> orig_log_level = console_loglevel;
> console_loglevel = 7;
> printk(KERN_INFO "SysRq : ");
>
> op_p = __sysrq_get_key_op(key);
> ...
> printk ("%s", op_p->action_msg);
> op_p->handler(key, pt_regs, kbd, tty);
> ...
> console_loglevel = orig_log_level;
>
> The killer here is the fact that the action message format string does
> not carry a newline, allowing people to register strings which leave the
> printk state open. The loglevel handler then fills in the loglevel, and
> closes the printk state.
>
> There was a time when I thought that was a good idea.
>
> Go ahead, laugh.
>
> Anyway, that sort of unresolved state is bad, and is the source of all
> of this song and dance. I think the right answer is to force handlers to
> open their own calls to printk, and to keep whats going on with the
> console_loglevel and printk buffer nice and clean.
>
> The cost is that messages like this:
>
> SysRq : Loglevel switched to X
>
> will have to become more like this:
>
> SysRq : Loglevel
> Loglevel switched to X
>
> Again, appologies, and a patch is forthcoming.
I've posted a patch (and copied you on it).
It's in 2.4.9-ac13.
You are welcome to post patches anyway, of course.
~Randy
next prev parent reply other threads:[~2001-09-21 21:44 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-09-19 15:56 Magic SysRq +# in 2.4.9-ac/2.4.10-pre12 Randy.Dunlap
2001-09-19 16:30 ` Randy.Dunlap
2001-09-19 16:42 ` Alan Cox
2001-09-19 18:02 ` Randy.Dunlap
2001-09-19 17:31 ` Erik Mouw
2001-09-19 17:34 ` Randy.Dunlap
2001-09-19 17:50 ` Randy.Dunlap
2001-09-19 17:52 ` Erik Mouw
2001-09-19 20:22 ` Vojtech Pavlik
2001-09-21 20:29 ` Crutcher Dunnavant
2001-09-26 20:38 ` Pavel Machek
2001-10-03 15:08 ` Crutcher Dunnavant
2001-09-21 21:08 ` Crutcher Dunnavant
2001-09-21 21:41 ` [PATCH] Magic SysRq loglevel fix Crutcher Dunnavant
2001-09-22 1:25 ` Randy.Dunlap
2001-09-22 5:16 ` Crutcher Dunnavant
2001-09-21 21:42 ` Randy.Dunlap [this message]
2001-09-21 22:07 ` Magic SysRq +# in 2.4.9-ac/2.4.10-pre12 Crutcher Dunnavant
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3BABB42A.6D17F44E@osdlab.org \
--to=rddunlap@osdlab.org \
--cc=crutcher@datastacks.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.