Re: [PATCH 6/23] Don't export machine_restart, machine_halt, ormachine_power_off.

From: Eric W. Biederman
Date: Tue Jul 26 2005 - 19:22:55 EST


Marc Ballarin <Ballarin.Marc@xxxxxx> writes:

> On Tue, 26 Jul 2005 11:36:01 -0600
> ebiederm@xxxxxxxxxxxx (Eric W. Biederman) wrote:
>
>>
>> machine_restart, machine_halt and machine_power_off are machine
>> specific hooks deep into the reboot logic, that modules
>> have no business messing with. Usually code should be calling
>> kernel_restart, kernel_halt, kernel_power_off, or
>> emergency_restart. So don't export machine_restart,
>> machine_halt, and machine_power_off so we can catch buggy users.
>
> The first is reiser4 in fs/reiser4/vfs_ops.c, line 1338.
> (Are filesystems supposed to restart the machine at all?!)

I suspect a call to panic would be more appropriate there.

I actually missed this one as I generated the patches against
Linus's latest tree.

Are we in process context where we can afford to do a clean shutdown
of the machine? I would have expected an error handling path to
not be able to do better than emergency_restart.

Regardless a panic sounds much more appropriate and will let the action
taken depend on the users policy.

Eric
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/