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

From: Marc Ballarin
Date: Tue Jul 26 2005 - 19:01:15 EST


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?!)

Patch not tested properly, since this seems to be in error handling code,
but compiles und runs fine.

--- linux-2.6.13-rc3-mm1/fs/reiser4/vfs_ops.c.orig 2005-07-27 01:41:41.326382750 +0200
+++ linux-2.6.13-rc3-mm1/fs/reiser4/vfs_ops.c 2005-07-27 01:42:56.783098500 +0200
@@ -1335,7 +1335,7 @@ reiser4_internal void reiser4_handle_err
sb->s_flags |= MS_RDONLY;
break;
case 2:
- machine_restart(NULL);
+ kernel_restart(NULL);
}
}
-
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/