Re: [PATCH] [3/48] Suspend2 2.1.9.8 for 2.6.12: 301-proc-acpi-sleep-activate-hook.patch

Matthew Garrett
2005-07-12T10:24:00Z

Nigel Cunningham <ncunningham@cyclades.com> wrote:
> On Tue, 2005-07-12 at 19:47, Matthew Garrett wrote:
>> In general, the kernel does very little to prevent users from shooting
>> themselves in the foot (or even chainsawing off their arms). We can do
>> these checks in userspace rather than adding more kernel code.
>
> Just because the kernel does very little, that doesn't mean it should.
> Particularly for something like suspend to disk, where it's not just a
> matter of an oops but of potential hard disk corruption, this is
> important.

The kernel isn't there to protect people. It's there to provide
functionality.

> If I could do it in userspace, I would. The trouble is, the userspace
> app may not be there to tell the user what is happening, and this might
> be part of the problem.

You're suggesting that users who are technically competent to compile
their own kernel and write their own initrd scripts are unable to deal
with checking whether or not a filesystem is mounted? You don't need an
application to do that, it's a simple matter of shell scripting. And, in
almost every case, if something is a simple matter of shell scripting it
shouldn't be in the kernel.
--
Matthew Garrett | mjg59-chiark.mail.linux-rutgers.kernel@srcf.ucam.org