The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "Serge E. Hallyn" <serue@us.ibm.com>
To: Greg KH <gregkh@suse.de>
Cc: Benjamin Thery <benjamin.thery@bull.net>,
	Andrew Morton <akpm@linux-foundation.org>,
	Eric Biederman <ebiederm@xmission.com>,
	Serge Hallyn <serue@us.ibm.com>,
	linux-kernel@vger.kernel.org, Tejun Heo <htejun@gmail.com>,
	Al Viro <viro@ftp.linux.org.uk>,
	Daniel Lezcano <dlezcano@fr.ibm.com>
Subject: Re: [PATCH 09/10] netns: Enable tagging for net_class directories in sysfs
Date: Tue, 3 Jun 2008 07:16:47 -0500	[thread overview]
Message-ID: <20080603121647.GA11503@us.ibm.com> (raw)
In-Reply-To: <20080603040818.GA18507@suse.de>

Quoting Greg KH (gregkh@suse.de):
> 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?

At least as far as the tagging goes, each namespace which needs to do
this (network, devices, and user, at least) will add a field to the
tag structure and call sysfs_enable_tagging() on the relevant
directories.  So no more core sysfs changes should be needed, as Eric
tried to make this generic enough to be generally useful.

> Can't this be done only in the network subsystem?

sysfs/kobject layer has to somehow decide what to show for
/sys/class/net contents based on the mountpoint, right, so I don't see
how the network subsystem could do it.

The only non-tagging alternative I'd see would be to keep entirely
separate kobject pools for each namespace.  To do that we'd probably
want to break /sys/class/net into a separate fs that can be
remounted, so at least we don't have to keep the rest of the kobject
pools (/sys/firmware, kernel, etc) in sync...

Eric had mentioned before breaking /sys into multiple mountpoints, so
I'll assume the fact that he implemented tagging means that there was
too much cross-linking and whatnot across the /sys tree to make that
feasible.

More importantly, that approach would require more core sysfs changes
for the next namespace, whereas the tagging approach does not!

thanks,
-serge

  reply	other threads:[~2008-06-03 12:17 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-02 13:44 [PATCH 00/10] sysfs tagged directories V4 Benjamin Thery
2008-06-02 13:44 ` [PATCH 01/10] sysfs: Support for preventing unmounts Benjamin Thery
2008-06-02 13:44 ` [PATCH 02/10] sysfs: sysfs_get_dentry add a sb parameter Benjamin Thery
2008-06-02 13:45 ` [PATCH 03/10] sysfs: Implement __sysfs_get_dentry Benjamin Thery
2008-06-02 13:45 ` [PATCH 04/10] sysfs: Rename Support multiple superblocks Benjamin Thery
2008-06-02 13:45 ` [PATCH 05/10] sysfs: sysfs_chmod_file handle " Benjamin Thery
2008-06-02 13:45 ` [PATCH 06/10] sysfs: Implement sysfs tagged directory support Benjamin Thery
2008-06-02 13:45 ` [PATCH 07/10] sysfs: Implement sysfs_delete_link and sysfs_rename_link Benjamin Thery
2008-06-02 13:45 ` [PATCH 08/10] driver core: Implement tagged directory support for device classes Benjamin Thery
2008-06-02 13:46 ` [PATCH 09/10] netns: Enable tagging for net_class directories in sysfs Benjamin Thery
2008-06-03  4:08   ` Greg KH
2008-06-03 12:16     ` Serge E. Hallyn [this message]
2008-06-03 15:24     ` Benjamin Thery
2008-06-03 16:35       ` Greg KH
2008-06-03 19:10         ` Benjamin Thery 
2008-06-02 13:46 ` [PATCH 10/10] sysfs: user namespaces: fix bug with clone(CLONE_NEWUSER) with fairsched Benjamin Thery
2008-06-02 19:24   ` Serge E. Hallyn
2008-06-02 21:17 ` [PATCH 00/10] sysfs tagged directories V4 Dan Smith

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=20080603121647.GA11503@us.ibm.com \
    --to=serue@us.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=benjamin.thery@bull.net \
    --cc=dlezcano@fr.ibm.com \
    --cc=ebiederm@xmission.com \
    --cc=gregkh@suse.de \
    --cc=htejun@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@ftp.linux.org.uk \
    /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