Re: [PATCH 09/10] netns: Enable tagging for net_class directoriesin sysfs

From: Benjamin Thery
Date: Tue Jun 03 2008 - 11:24:08 EST


Greg KH wrote:
On Mon, Jun 02, 2008 at 03:46:08PM +0200, Benjamin Thery wrote:
net: Enable tagging for net_class directories in sysfs

The problem. Network devices show up in sysfs and with the network
namespace active multiple devices with the same name can show up in
the same directory, ouch!

To avoid that problem and allow existing applications in network namespaces
to see the same interface that is currently presented in sysfs, this
patch enables the tagging directory support in sysfs.

By using the network namespace pointers as tags to separate out the
the sysfs directory entries we ensure that we don't have conflicts
in the directories and applications only see a limited set of
the network devices.

I don't like it how the network subsystem is starting to leach into the
sysfs core here. What happens when the next subsystem wants to do the
same thing? And then the next one? Will they all have to do this kind
of intrusive changes to sysfs?
>
> Can't this be done only in the network subsystem?

I'm not sure to understand exactly what you mean.

What you don't like is seeing these hunks of network code in
fs/sysfs/mount.c? And you prefer to see these bits of code resides in
the network subsystem instead and see only "generic" sysfs services in
fs/sysfs/mount.c?

If this is it, I have some idea to implement a less intrusive
sysfs_net_exit(), which can be shared with the other namespaces.
Serge introduces the same kind of changes in patch 10 to fix an issue in user namespace. I think we can share a bit of code and move the parts
specific to each namespace in their own subsystems.

Benjamin


thanks,

greg k-h




--
B e n j a m i n T h e r y - BULL/DT/Open Software R&D

http://www.bull.com
--
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/