OpenVZ Forum - RDF feed
type: channel
items: [PATCH] net: Fix running without sysfs
items: Re: [PATCH] net: Fix running without sysfs

[PATCH] net: Fix running without sysfs
type: item
description: When sysfs support is compiled out the kernel still keeps and maintains the kobject tree. So it is not safe to skip our kobject reference counting or to avoid becoming members of the kobject tree. It is safe to not add the networking specific sysfs attributes. This patch removes the sysfs special cases from net/core/dev.c renames functions from netdev_sysfs_xxxx to netdev_kobject_xxxx and always compiles in net-sysfs.c net-sysfs.c is modified with a CONFIG_SYSFS guard around the parts that are actually sysfs specific. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> --- net/core/Makefile | 2 +- net/core/dev.c | 28 +++++++++------------------- net/core/net-sysfs.c | 13 ++++++++++--- 3 files changed, 20 insertions(+), 23 deletions(-) diff --git a/net/core/Makefile b/net/core/Makefile index ea9b3f3..b1332f6 100644 --- a/net/core/Makefile +++ b/net/core/Makefile @@ -11,7 +11,7 @@ obj-y += dev.o ethtool.o dev_mcast.o dst.o netevent.o \ neighbour.o rtnetlink.o utils.o link_watch.o filter.o obj-$(CONFIG_XFRM) += flow.o -obj-$(CONFIG_SYSFS) += net-sysfs.o +obj-y += net-sysfs.o obj-$(CONFIG_NET_PKTGEN) += pktgen.o obj-$(CONFIG_NETPOLL) += netpoll.o obj-$(CONFIG_NET_DMA) += user_dma.o diff --git a/net/core/dev.c b/net/core/dev.c index 91c31e6..a99225e 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -249,15 +249,9 @@ static RAW_NOTIFIER_HEAD(netdev_chain); DEFINE_PER_CPU(struct softnet_data, softnet_data); -#ifdef CONFIG_SYSFS -extern int netdev_sysfs_init(void); -extern int netdev_register_sysfs(struct net_device *); -extern void netdev_unregister_sysfs(struct net_device *); -#else -#define netdev_sysfs_init() (0) -#define netdev_register_sysfs(dev) (0) -#define netdev_unregister_sysfs(dev) do { } while(0) -#endif +extern int netdev_kobject_init(void); +extern int netdev_register_kobject(struct net_device *); +extern void netdev_unregister_kobject(struct net_device *); #ifdef CONFIG_DEBUG_LOCK_ALLOC /* @@ -3573,7 +3567,7 @@ int register_netdevice(struct net_device…
creator: ebiederm
date: 2007-09-26T23:48:10-00:00

Re: [PATCH] net: Fix running without sysfs
type: item
description: On Wed, 26 Sep 2007 17:48:10 -0600 ebiederm@xmission.com (Eric W. Biederman) wrote: > > When sysfs support is compiled out the kernel still keeps and maintains > the kobject tree. So it is not safe to skip our kobject reference counting or > to avoid becoming members of the kobject tree. It is safe to not add > the networking specific sysfs attributes. > > This patch removes the sysfs special cases from net/core/dev.c > renames functions from netdev_sysfs_xxxx to netdev_kobject_xxxx > and always compiles in net-sysfs.c > > net-sysfs.c is modified with a CONFIG_SYSFS guard around the parts > that are actually sysfs specific. > > Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Acked-by: Stephen Hemminger <shemminger@linux-foundation.org> Looks good. It also fixes a use after-free in netdev_run_todo when !CONFIG_SYSFS -- Stephen Hemminger <shemminger@linux-foundation.org> _______________________________________________ Containers mailing list Containers@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/containers
creator: Stephen Hemminger
date: 2007-09-27T00:07:14-00:00

Re: [PATCH] net: Fix running without sysfs
type: item
description: From: ebiederm@xmission.com (Eric W. Biederman) Date: Wed, 26 Sep 2007 17:48:10 -0600 > > When sysfs support is compiled out the kernel still keeps and maintains > the kobject tree. So it is not safe to skip our kobject reference counting or > to avoid becoming members of the kobject tree. It is safe to not add > the networking specific sysfs attributes. > > This patch removes the sysfs special cases from net/core/dev.c > renames functions from netdev_sysfs_xxxx to netdev_kobject_xxxx > and always compiles in net-sysfs.c > > net-sysfs.c is modified with a CONFIG_SYSFS guard around the parts > that are actually sysfs specific. > > Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Applied to net-2.6.24 _______________________________________________ Containers mailing list Containers@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/containers
creator: davem
date: 2007-09-27T05:03:05-00:00