From: Rob Landley <rob@landley.net>
To: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: dougg@torque.net, James Bottomley <James.Bottomley@steeleye.com>,
linux-scsi@vger.kernel.org
Subject: Re: Some quick scsi documentation questions:
Date: Fri, 3 Aug 2007 15:07:30 -0400 [thread overview]
Message-ID: <200708031407.31175.rob@landley.net> (raw)
In-Reply-To: <46B2E41F.7090705@s5r6.in-berlin.de>
On Friday 03 August 2007 3:15:27 am Stefan Richter wrote:
> Rob Landley wrote:
> > On Thursday 02 August 2007 5:39:55 pm Stefan Richter wrote:
> >> The place where these symlinks live might change in the future. See
> >> linux-2.6.23*/Documentation/sysfs-rules.txt.
> >
> > I noticed this. I had a longish flamewar with Greg KH about this, which
> > would be ongoing if he hadn't stopped replying.
> >
> > It's easy to find out information like this by experimenting with sysfs.
> > And then they change it in future versions, and blame the user for using
> > what sysfs exports.
>
> Sysfs lets you peek into kernel implementation details.
/sys/class containing all char devices and /sys/block containing all block
devices was not an implementation detail. Breaking this assumption by adding
more char devices under /sys/bus and moving /sys/block moving
under /sys/class is not an implementation detail. Deprecating the "device"
symlink was not an implementation detail.
They keep using the fact that they're exporting random kernel data as an
excuse for not documenting a stable subset of this as an API userspace can
rely on.
> Hence what you
> see in sysfs will change all the time when the implementation is
> changed. It's important to realize this before making use of sysfs.
It changes dynamically as stuff is hotplugged. That's no excuse for them not
making up their minds about what is and isn't a good idea to export, and
where to put it.
> Sysfs (most of it) is not a stable ABI.
I've noticed this. This is a bug, not a feature. Linux has always had a
stable _USERSPACE_ API. This is exposed to userspace, and userspace is
expected to be able to use this. If they're exporting stuff they shouldn't
be exporting, then they should stop exporting it. That's no excuse for
moving everything around, deprecating paths that used to be the primary way
to access data that's still exported, just somewhere else...
> Never has been, never will be,
> never was intended to be. That's overlooked again and again.
I want to scan sysfs to find:
A) all block devices.
B) all char devices.
C) Whatever attributes of those devices that allow them to be persistently
identified.
This goal hasn't changed since 2.6.10 or so, but sysfs has changed how we're
expected to do it, and often they've changed it for no good reason from a UI
perspective.
> If you want to do something that requires a stable ABI between kernel
> and userspace, then use such a stable ABI (including the small parts of
> sysfs that have been declared stable and hence will remain stable).
You mean like libsysfs? :)
Rob
--
"One of my most productive days was throwing away 1000 lines of code."
- Ken Thompson.
next prev parent reply other threads:[~2007-08-03 19:09 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200707252328.28981.rob@landley.net>
[not found] ` <1185455711.3501.46.camel@localhost.localdomain>
2007-07-27 21:29 ` Some quick scsi documentation questions: Rob Landley
2007-08-02 18:41 ` Douglas Gilbert
2007-08-02 21:19 ` Stefan Richter
2007-08-03 0:55 ` Rob Landley
2007-08-03 10:43 ` Stefan Richter
2007-08-03 21:11 ` Rob Landley
2007-08-04 0:08 ` Stefan Richter
2007-08-04 0:35 ` Stefan Richter
2007-08-05 16:50 ` Douglas Gilbert
2007-08-06 16:29 ` Rob Landley
2007-08-06 18:30 ` Stefan Richter
2007-08-02 21:39 ` Stefan Richter
2007-08-03 1:12 ` Rob Landley
2007-08-03 8:15 ` Stefan Richter
2007-08-03 19:07 ` Rob Landley [this message]
2007-08-03 19:37 ` Stefan Richter
2007-08-03 21:39 ` Rob Landley
2007-08-03 0:39 ` Rob Landley
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=200708031407.31175.rob@landley.net \
--to=rob@landley.net \
--cc=James.Bottomley@steeleye.com \
--cc=dougg@torque.net \
--cc=linux-scsi@vger.kernel.org \
--cc=stefanr@s5r6.in-berlin.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox