LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* new sysfs layout and ethernet device names
@ 2007-03-20 17:01 Bill Nottingham
2007-03-22 8:47 ` Kay Sievers
0 siblings, 1 reply; 8+ messages in thread
From: Bill Nottingham @ 2007-03-20 17:01 UTC (permalink / raw)
To: linux-kernel
I was fiddling with the 'new' (no CONFIG_SYSFS_DEPRECATED) layout
and ethernet device names, and noticed that the new layout effectively
restricts the availability of certain device names.
By making a directory for the ethernet device name in the parent
device, you no longer can use any name that is used in sysfs for
the parent device type - for PCI devices this would be 'resource0',
'power', 'enable', etc. For USB, it would be a different set
of names that are no longer available.
If you *do* try to use one of these names, the rename will succeed...
partway. The link in /sys/class/net is renamed, the directory is
not (as it obviously can't rename on top of whatever is already there.)
Various networking tools then break in assorted ways due to the
naming disconnect.
Going back to the deprecated layout makes these names available again -
it's possible (although not necessarily likely) that the new layout
will break someone's device configuration if they upgrade kernels,
even if the rest of their tools are updated for the new layout.
Bill
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: new sysfs layout and ethernet device names
2007-03-20 17:01 new sysfs layout and ethernet device names Bill Nottingham
@ 2007-03-22 8:47 ` Kay Sievers
2007-03-28 3:17 ` Bill Nottingham
0 siblings, 1 reply; 8+ messages in thread
From: Kay Sievers @ 2007-03-22 8:47 UTC (permalink / raw)
To: Bill Nottingham; +Cc: linux-kernel, Greg KH
On 3/20/07, Bill Nottingham <notting@redhat.com> wrote:
> I was fiddling with the 'new' (no CONFIG_SYSFS_DEPRECATED) layout
> and ethernet device names, and noticed that the new layout effectively
> restricts the availability of certain device names.
>
> By making a directory for the ethernet device name in the parent
> device, you no longer can use any name that is used in sysfs for
> the parent device type - for PCI devices this would be 'resource0',
> 'power', 'enable', etc. For USB, it would be a different set
> of names that are no longer available.
Yeah, we heard, people want to name their network interfaces "irq". :)
> If you *do* try to use one of these names, the rename will succeed...
> partway. The link in /sys/class/net is renamed, the directory is
> not (as it obviously can't rename on top of whatever is already there.)
> Various networking tools then break in assorted ways due to the
> naming disconnect.
>
> Going back to the deprecated layout makes these names available again -
> it's possible (although not necessarily likely) that the new layout
> will break someone's device configuration if they upgrade kernels,
> even if the rest of their tools are updated for the new layout.
There will be a directory at the bus-device with the name of the
class, that glues together the bus-devices and the class-devices in
the unified tree:
http://git.kernel.org/?p=linux/kernel/git/gregkh/patches.git;a=blob;f=driver/driver-core-fix-namespace-issue-with-devices-assigned-to-classes.patch;hb=HEAD
So the network-interface(s) will be in their own directory "net",
below the bus-device, and don't conflict with the existing attributes.
Thanks,
Kay
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: new sysfs layout and ethernet device names
2007-03-22 8:47 ` Kay Sievers
@ 2007-03-28 3:17 ` Bill Nottingham
2007-03-28 4:10 ` Greg KH
0 siblings, 1 reply; 8+ messages in thread
From: Bill Nottingham @ 2007-03-28 3:17 UTC (permalink / raw)
To: Kay Sievers; +Cc: linux-kernel, Greg KH
Kay Sievers (kay.sievers@vrfy.org) said:
> >If you *do* try to use one of these names, the rename will succeed...
> >partway. The link in /sys/class/net is renamed, the directory is
> >not (as it obviously can't rename on top of whatever is already there.)
> >Various networking tools then break in assorted ways due to the
> >naming disconnect.
> >
> >Going back to the deprecated layout makes these names available again -
> >it's possible (although not necessarily likely) that the new layout
> >will break someone's device configuration if they upgrade kernels,
> >even if the rest of their tools are updated for the new layout.
>
> There will be a directory at the bus-device with the name of the
> class, that glues together the bus-devices and the class-devices in
> the unified tree:
> http://git.kernel.org/?p=linux/kernel/git/gregkh/patches.git;a=blob;f=driver/driver-core-fix-namespace-issue-with-devices-assigned-to-classes.patch;hb=HEAD
>
> So the network-interface(s) will be in their own directory "net",
> below the bus-device, and don't conflict with the existing attributes.
So, the layout will change again?
Bill
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: new sysfs layout and ethernet device names
2007-03-28 3:17 ` Bill Nottingham
@ 2007-03-28 4:10 ` Greg KH
2007-03-29 0:41 ` Bill Nottingham
0 siblings, 1 reply; 8+ messages in thread
From: Greg KH @ 2007-03-28 4:10 UTC (permalink / raw)
To: Kay Sievers, linux-kernel
On Tue, Mar 27, 2007 at 11:17:43PM -0400, Bill Nottingham wrote:
> Kay Sievers (kay.sievers@vrfy.org) said:
> > >If you *do* try to use one of these names, the rename will succeed...
> > >partway. The link in /sys/class/net is renamed, the directory is
> > >not (as it obviously can't rename on top of whatever is already there.)
> > >Various networking tools then break in assorted ways due to the
> > >naming disconnect.
> > >
> > >Going back to the deprecated layout makes these names available again -
> > >it's possible (although not necessarily likely) that the new layout
> > >will break someone's device configuration if they upgrade kernels,
> > >even if the rest of their tools are updated for the new layout.
> >
> > There will be a directory at the bus-device with the name of the
> > class, that glues together the bus-devices and the class-devices in
> > the unified tree:
> > http://git.kernel.org/?p=linux/kernel/git/gregkh/patches.git;a=blob;f=driver/driver-core-fix-namespace-issue-with-devices-assigned-to-classes.patch;hb=HEAD
> >
> > So the network-interface(s) will be in their own directory "net",
> > below the bus-device, and don't conflict with the existing attributes.
>
> So, the layout will change again?
If you follow the rules in Documentation/ABI/testing/sysfs-class your
program will not have any problems.
And yes, it will change by adding another subdirectory in the device
tree, but just follow the link from the /sys/class/ directorys and you
will be fine.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: new sysfs layout and ethernet device names
2007-03-28 4:10 ` Greg KH
@ 2007-03-29 0:41 ` Bill Nottingham
2007-03-30 2:31 ` Greg KH
0 siblings, 1 reply; 8+ messages in thread
From: Bill Nottingham @ 2007-03-29 0:41 UTC (permalink / raw)
To: Greg KH; +Cc: Kay Sievers, linux-kernel
Greg KH (greg@kroah.com) said:
> If you follow the rules in Documentation/ABI/testing/sysfs-class your
> program will not have any problems.
Oh, of *course*. We add interfaces and then claim years later,
after code has been written, "Oh, you shouldn't be using that!" in
documentation. Meanwhile, such code using the old interface will still
a) continue to compile b) continue to run without any sort of warnings.
If interfaces have to change, so be it. But changing the rules for
using them years after it's implemented and then claiming "you didn't
read the instructions" is pretty lame.
Bill
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: new sysfs layout and ethernet device names
2007-03-29 0:41 ` Bill Nottingham
@ 2007-03-30 2:31 ` Greg KH
2007-03-30 3:29 ` Bill Nottingham
0 siblings, 1 reply; 8+ messages in thread
From: Greg KH @ 2007-03-30 2:31 UTC (permalink / raw)
To: Kay Sievers, linux-kernel
On Wed, Mar 28, 2007 at 08:41:38PM -0400, Bill Nottingham wrote:
> Greg KH (greg@kroah.com) said:
> > If you follow the rules in Documentation/ABI/testing/sysfs-class your
> > program will not have any problems.
>
> Oh, of *course*. We add interfaces and then claim years later,
> after code has been written, "Oh, you shouldn't be using that!" in
> documentation. Meanwhile, such code using the old interface will still
> a) continue to compile b) continue to run without any sort of warnings.
>
> If interfaces have to change, so be it. But changing the rules for
> using them years after it's implemented and then claiming "you didn't
> read the instructions" is pretty lame.
That documentation has been in the kernel tree for almost a full year:
commit c18f6365fdbaf30611a8822afcd7097865dcaa32
Author: Greg Kroah-Hartman <gregkh@suse.de>
Date: Thu Apr 27 14:10:12 2006 -0700
[PATCH] Add kernel<->userspace ABI stability documentation
And Kay and I have been saying to not to rely on directories for over
two years now...
Anyway, yes, older code should still "just work" if you enable the
CONFIG_SYSFS_DEPRECATED config option in the kernel, that is what it is
there for.
If you have any problems with that option enabled, please let me know
and I will be glad to fix it up.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: new sysfs layout and ethernet device names
2007-03-30 2:31 ` Greg KH
@ 2007-03-30 3:29 ` Bill Nottingham
2007-03-30 5:26 ` Greg KH
0 siblings, 1 reply; 8+ messages in thread
From: Bill Nottingham @ 2007-03-30 3:29 UTC (permalink / raw)
To: Greg KH; +Cc: Kay Sievers, linux-kernel
Greg KH (greg@kroah.com) said:
> > If interfaces have to change, so be it. But changing the rules for
> > using them years after it's implemented and then claiming "you didn't
> > read the instructions" is pretty lame.
>
> That documentation has been in the kernel tree for almost a full year:
It has a date on it. I'm not blind. That doesn't change the fact that
that documentation:
> Date: Thu Apr 27 14:10:12 2006 -0700
postdates the interface it's describing by at *least* two years. Which
was the point of my mail that you conveniently ignored - retroactively
deciding which parts of the interface you export to userspace shouldn't be
used falls way short of best practices.
> Anyway, yes, older code should still "just work" if you enable the
> CONFIG_SYSFS_DEPRECATED config option in the kernel, that is what it is
> there for.
It appears to... the point was that (as far as the code is concerned)
it's a silent break. Of course, code that expects the 'current' layout
will then break when this new change is made, unless you add
CONFIG_SYSFS_SLIGHTLY_LESS_DEPRECATED?
Bill
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: new sysfs layout and ethernet device names
2007-03-30 3:29 ` Bill Nottingham
@ 2007-03-30 5:26 ` Greg KH
0 siblings, 0 replies; 8+ messages in thread
From: Greg KH @ 2007-03-30 5:26 UTC (permalink / raw)
To: Kay Sievers, linux-kernel
On Thu, Mar 29, 2007 at 11:29:05PM -0400, Bill Nottingham wrote:
> Greg KH (greg@kroah.com) said:
> > > If interfaces have to change, so be it. But changing the rules for
> > > using them years after it's implemented and then claiming "you didn't
> > > read the instructions" is pretty lame.
> >
> > That documentation has been in the kernel tree for almost a full year:
>
> It has a date on it. I'm not blind. That doesn't change the fact that
> that documentation:
>
> > Date: Thu Apr 27 14:10:12 2006 -0700
>
> postdates the interface it's describing by at *least* two years. Which
> was the point of my mail that you conveniently ignored - retroactively
> deciding which parts of the interface you export to userspace shouldn't be
> used falls way short of best practices.
I am not disagreeing with that, that is why the config option is
present.
> > Anyway, yes, older code should still "just work" if you enable the
> > CONFIG_SYSFS_DEPRECATED config option in the kernel, that is what it is
> > there for.
>
> It appears to... the point was that (as far as the code is concerned)
> it's a silent break. Of course, code that expects the 'current' layout
> will then break when this new change is made, unless you add
> CONFIG_SYSFS_SLIGHTLY_LESS_DEPRECATED?
Well, the idea is that over time, older things will move under this
config option. If you disable it, you will have a "cleaner" sysfs tree,
but if you enable it, it should all just look the same.
Now some people have proposed versioning the sysfs interface (1, 2, 3,
etc.) and have a config option for that. I don't know if that's really
necessary just yet, but am considering it for future changes.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2007-03-30 5:27 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-20 17:01 new sysfs layout and ethernet device names Bill Nottingham
2007-03-22 8:47 ` Kay Sievers
2007-03-28 3:17 ` Bill Nottingham
2007-03-28 4:10 ` Greg KH
2007-03-29 0:41 ` Bill Nottingham
2007-03-30 2:31 ` Greg KH
2007-03-30 3:29 ` Bill Nottingham
2007-03-30 5:26 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).