All of lore.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Pavel Machek <pavel@suse.cz>
Cc: Andrew Morton <akpm@osdl.org>,
	Zwane Mwaikambo <zwane@arm.linux.org.uk>,
	"Raj, Ashok" <ashok.raj@intel.com>, Andi Kleen <ak@suse.de>,
	Dave Jones <davej@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Don't attempt to power off if power off is not implemented.
Date: Wed, 14 Dec 2005 10:12:41 -0700	[thread overview]
Message-ID: <m164pra9h2.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <19700102031329.GA2372@ucw.cz> (Pavel Machek's message of "Fri, 2 Jan 1970 03:13:29 +0000")

Pavel Machek <pavel@suse.cz> writes:

> Hi!
>
>> diff --git a/kernel/sys.c b/kernel/sys.c
>> index bce933e..bf5842f 100644
>> --- a/kernel/sys.c
>> +++ b/kernel/sys.c
>> @@ -488,6 +488,12 @@ asmlinkage long sys_reboot(int magic1, i
>>  	                magic2 != LINUX_REBOOT_MAGIC2C))
>>  		return -EINVAL;
>>  
>> +	/* Instead of trying to make the power_off code look like
>> +	 * halt when pm_power_off is not set do it the easy way.
>> +	 */
>> +	if ((cmd == LINUX_REBOOT_CMD_POWER_OFF) && !pm_power_off)
>> +		cmd = LINUX_REBOOT_CMD_HALT;
>> +
>>  	lock_kernel();
>>  	switch (cmd) {
>>  	case LINUX_REBOOT_CMD_RESTART:
>
> Would not it be better to return -EPERM here or something like that?
> That way userspace can decide that it really wants reboot or something
> else.

Because that would change the current semantics of what
LINUX_REBOOT_CMD_POWER_OFF.

It is painful enough getting the infrastructure change through without
the having to worry about breaking userspace as well.

Despite what it may look like this is purely to fix bugs in the
implementation.

If I was going to hack user space the quick fix is to remove the -p
flag passed to /sbin/halt in the reboot scripts.

Eric

  reply	other threads:[~2005-12-14 17:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-27 10:05 [PATCH] i386/x86_64: Don't IPI to offline cpus on shutdown Zwane Mwaikambo
2005-11-27 13:58 ` Andi Kleen
2005-11-27 14:14   ` Eric W. Biederman
2005-11-27 16:45     ` Zwane Mwaikambo
2005-11-28  2:27       ` Eric W. Biederman
2005-11-28  5:33         ` Andi Kleen
2005-11-28 17:29         ` Zwane Mwaikambo
     [not found]         ` <Pine.LNX.4.64.0512021221210.13220@montezuma.fsmlabs.com>
     [not found]           ` <m1iru7dlww.fsf@ebiederm.dsl.xmission.com>
     [not found]             ` <Pine.LNX.4.64.0512050014000.6637@montezuma.fsmlabs.com>
     [not found]               ` <m1zmncb0n5.fsf@ebiederm.dsl.xmission.com>
     [not found]                 ` <Pine.LNX.4.64.0512072158500.2557@montezuma.fsmlabs.com>
     [not found]                   ` <m1vey0azeu.fsf@ebiederm.dsl.xmission.com>
     [not found]                     ` <Pine.LNX.4.64.0512072249000.2557@montezuma.fsmlabs.com>
2005-12-08  7:39                       ` [PATCH] Don't attempt to power off if power off is not implemented Eric W. Biederman
1970-01-02  3:13                         ` Pavel Machek
2005-12-14 17:12                           ` Eric W. Biederman [this message]
2005-12-11 22:57                         ` Paul Jackson

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=m164pra9h2.fsf@ebiederm.dsl.xmission.com \
    --to=ebiederm@xmission.com \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=ashok.raj@intel.com \
    --cc=davej@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@suse.cz \
    --cc=zwane@arm.linux.org.uk \
    /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.