Re: Golden rule: don't break userland (was Re: RFC: Starting a stable kernel series off the 2.6 kernel)

From: Greg KH
Date: Sat Dec 03 2005 - 15:35:29 EST


On Sat, Dec 03, 2005 at 01:43:48PM -0500, Jeff Garzik wrote:
>
> Userland isn't the same. IMO sysfs hackers have forgotten this.

No we have not.

> Anytime you change or remove sysfs attributes these days, you have the
> potential to break userland, which breaks one of the grand axioms of
> Linux. Everybody knows "the rules" when it comes to removing system
> calls, but forgets/ignores them when it comes to ioctls, sysfs
> attributes, and the like.

The _main_ reason of making sysfs contain "one value per file" was to
help mitigate the problems that proc has had in the past where file
format changes broke userspace programs.

Programs that rely on sysfs need to be able to safely handle the fact
that some attributes might or might not be there.

Now to be fair, yes, udev has had big problems with this in the past,
and kernel updates have broken udev. But that was because the bug was
MY fault in udev, not in the kernel. I'll take full responsibility for
that.

And in the future, the driver/class model changes we are going to be
doing (see http://lwn.net/Articles/162242/ for more details on this),
will be going to great lengths to prevent anything in userspace from
breaking.

So, to change your wording a bit, users of sysfs have forgotten how to
program defensively to handle changes that might happen in the future.
I know I'm guilty of this, and am working hard to not make the same
mistakes in the future.

thanks,

greg "still trying to delete devfs after 1 and 1/2 years notice" k-h
-
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/