From: Stephen Hemminger <shemminger@osdl.org>
To: Zwane Mwaikambo <zwane@fsmlabs.com>,
"David S. Miller" <davem@redhat.com>
Cc: Greg KH <greg@kroah.com>, Andrew Morton <akpm@osdl.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH][2.6] fix bridge sysfs improperly initialised knobject
Date: Thu, 17 Jun 2004 13:46:36 -0700 [thread overview]
Message-ID: <20040617134636.216f430e@dell_ss3.pdx.osdl.net> (raw)
In-Reply-To: <Pine.LNX.4.58.0406161247140.1944@montezuma.fsmlabs.com>
> The bridge sysfs interface introduced around 2.6.7-rc1 created a bad
> entry in /sys because it didn't initialise the name member of the kobject.
>
> zwane@montezuma /sys {0:0} ls -l
> total 0
> ?--------- ? ? ? ? ?
> drwxr-xr-x 17 root root 0 Jun 15 15:47 block
> drwxr-xr-x 7 root root 0 Jun 15 15:47 bus
> drwxr-xr-x 16 root root 0 Jun 15 15:47 class
> drwxr-xr-x 5 root root 0 Jun 15 15:47 devices
> drwxr-xr-x 3 root root 0 Jun 15 15:47 firmware
> drwxr-xr-x 8 root root 0 Jun 15 19:55 module
>
> Index: linux-2.6.7-rc3-mm2/net/bridge/br_sysfs_br.c
> ===================================================================
> RCS file: /home/cvsroot/linux-2.6.7-rc3-mm2/net/bridge/br_sysfs_br.c,v
> retrieving revision 1.1.1.1
> diff -u -p -B -r1.1.1.1 br_sysfs_br.c
> --- linux-2.6.7-rc3-mm2/net/bridge/br_sysfs_br.c 14 Jun 2004 12:49:12 -0000 1.1.1.1
> +++ linux-2.6.7-rc3-mm2/net/bridge/br_sysfs_br.c 16 Jun 2004 16:45:20 -0000
> @@ -305,9 +305,7 @@ static struct bin_attribute bridge_forwa
> * This is a dummy kset so bridge objects don't cause
> * hotplug events
> */
> -struct subsystem bridge_subsys = {
> - .kset = { .hotplug_ops = NULL },
> -};
> +decl_subsys_name(bridge, net_bridge, NULL, NULL);
>
> void br_sysfs_init(void)
> {
Yes, this would get rid of the name, but then wouldn't bridge show up
as top level subsystem /sys/bridge.
Is there no way to register without causing bogus hotplug events?
I am getting a bad taste about the whole sysfs programming model, since
it seems like programming by side effect. it would be better for sysfs
to handle the case of hidden subsystems, or provide an alternate way
not to generate hotplug events.
next prev parent reply other threads:[~2004-06-17 20:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-16 23:48 Zwane Mwaikambo
2004-06-17 20:46 ` Stephen Hemminger [this message]
2004-06-17 20:51 ` David S. Miller
2004-06-17 20:58 ` Greg KH
2004-06-17 21:45 ` Stephen Hemminger
2004-06-18 20:19 ` David S. Miller
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=20040617134636.216f430e@dell_ss3.pdx.osdl.net \
--to=shemminger@osdl.org \
--cc=akpm@osdl.org \
--cc=davem@redhat.com \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=zwane@fsmlabs.com \
/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
all inboxes | Powered by JetHome®