public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: shawn@churchofgit.com
To: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
Cc: "Shawn Landden" <shawn@churchofgit.com>,
	"Jiri Slaby" <jslaby@suse.cz>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tty: only print sysrq help for handlers that are enabled
Date: Tue, 24 Dec 2013 05:04:54 -0000	[thread overview]
Message-ID: <4051ac2a919c34e44113669e84ca7e8b.squirrel@localhost> (raw)
In-Reply-To: <20131213023239.GA15130@kroah.com>

> On Tue, Dec 03, 2013 at 07:55:25AM -0800, Shawn Landden wrote:
>> Also print out a notice when sysrq is in selective mode.
>>
>> Signed-off-by: Shawn Landden <shawn@churchofgit.com>
>> ---
>>  drivers/tty/sysrq.c | 7 ++++++-
>>  1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c
>> index ce396ec..4eee0e4 100644
>> --- a/drivers/tty/sysrq.c
>> +++ b/drivers/tty/sysrq.c
>> @@ -548,9 +548,14 @@ void __handle_sysrq(int key, bool check_mask)
>>  					;
>>  				if (j != i)
>>  					continue;
>> -				printk("%s ", sysrq_key_table[i]->help_msg);
>> +				/* only print if handler is enabled */
>> +				if (sysrq_enabled & 1 ||
>> +				    sysrq_enabled & sysrq_key_table[i]->enable_mask)
>> +					printk("%s ", sysrq_key_table[i]->help_msg);
>>  			}
>>  		}
>> +		if (!(sysrq_enabled & 1))
>> +			printk("(some options are disabled)");
>>  		printk("\n");
>>  		console_loglevel = orig_log_level;
>>  	}
>
> What exactly is this fixing?  What is broken here that this change
> resolves?  Where is it applicable?  I need a lot more context here
> please.

Without this patch you get something like
re[b]oot [r]aw [s]ync [h]elp ....
even if none of these sysrq triggers are available because of the setting
mask of
kernel.sysrq
With this patch then if (e.g.)
kernel.sysrq = 16
then you will only see
[s]ync
i.e. those commands you have privilege to issue via sysrq keypresses.
Contact me if you need more,
Shawn
>
> thanks,
>
> greg k-h
>



  reply	other threads:[~2013-12-24  5:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-03 15:55 [PATCH] tty: only print sysrq help for handlers that are enabled Shawn Landden
2013-12-13  2:32 ` Greg Kroah-Hartman
2013-12-24  5:04   ` shawn [this message]
2013-12-24 12:43     ` Peter Hurley

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=4051ac2a919c34e44113669e84ca7e8b.squirrel@localhost \
    --to=shawn@churchofgit.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.cz \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox