linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/11] sysfs tagged directories V6
@ 2008-06-18 17:07 Benjamin Thery
  2008-06-18 17:07 ` [PATCH 01/11] sysfs: Support for preventing unmounts Benjamin Thery
                   ` (10 more replies)
  0 siblings, 11 replies; 138+ messages in thread
From: Benjamin Thery @ 2008-06-18 17:07 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Andrew Morton
  Cc: Eric Biederman, Daniel Lezcano, Serge Hallyn, linux-kernel,
	Tejun Heo, Al Viro, Linux Containers, Benjamin Thery

Greg, Andrew,

Here is yet another updated version of Eric Biederman's patchset to 
implement tagged directories in sysfs ported on top of 2.6.26-rc5-mm3.
This may be easier for you to review as 2.6.26-rc2-mm1 was getting a 
bit old now.

There is no major changes since the last version which introduced some 
changes to address concerns from Greg about the patch "Enable tagging 
for net_class directories" being to intrusive in sysfs core. 

Refer to the Changelog below and 
http://thread.gmane.org/gmane.linux.kernel/690799 to read the details 
about the proposed changes (I didn't copy them here to save some space).

Andrew,

Can you consider merging this patchset in -mm until Greg has time
to re-review it and take it (or reject it)?

Thanks,
Benjamin

(Below you'll find the traditional introduction for sysfs tagged dirs 
and the updated changelog)

--

With the introduction of network namespaces, there can be duplicate 
network interface names on the same machine. Indeed, two network 
interfaces can have the same name if they reside in different network
namespaces. 

* Network interfaces names show up in sysfs.
* Today there is nothing in sysfs that is currently per namespace.
* Therefore we need to support multiple mounts of sysfs each showing a 
  different network namespace.

We introduce tagged directories in sysfs for this purpose.

Of course the usefulness of this feature is not limited to network stuff:
Serge Hallyn wrote a patch to fix a similar issue with user namespaces based 
on this patchset. His patch is included at the end of the patchset.

Tested with and without SYSFS_DEPRECATED. No regression found so far.

Changelog
---------
* V6:
  - Ported to 2.6.26-rc5-mm3
  - Patch 11 (userns) Removed an unused kset member from struct 
    user_namespace left from a previous version of the patch.
* V5:
  - Make namespace tags a bit less intrusive in sysfs core:
    - New patch 09: Added a generic sysfs_ns_exit routine called by 
      exiting namespaces. A callback is passed to this routine to 
      execute the subsystem specific code.
    - Modified patches 09 and 10 (now 10 and 11) ("netns tagging" and 
      "userns tagging") to use this new routine instead of adding 
      #ifdef'd code in fs/sysfs/mount.c.
  - Added missing -ENOMEM in fs/sysfs/dir.c:prep_rename() (Roel Kluin)
* V4:
  - Ported to 2.6.26-rc2-mm1
  - Updated patch for user namespace by Serge Hallyn (patch 10).
* V3:
  - Removed patch 10 ("avoid kobject name conflict with different 
    namespaces"), a better one was provided by Eric.
  - Removed patch 11 ("sysfs: user namespaces: add ns to user_struct"),
    Serge needs to rework some parts of it.
  - Change Acked-by: to Signed-off-by:, someone told me it is more 
    appropriate (as I'm in the delivery path).


Here is the announcement Eric wrote back in December to introduce his 
patchset:

"
Now that we have network namespace support merged it is time to
revisit the sysfs support so we can remove the dependency on !SYSFS.
[...]
The bulk of the patches are the changes to allow multiple sysfs
superblocks.

Then comes the tagged directory sysfs support which uses information
captured at mount time to decide which object with which tag will
appear in a directory.

Then the support for renaming and deleting objects where the source
may be ambiguous because of tagging.

Then finally the network namespace support so it is clear how all
of this tied together.
"

Regards,
Benjamin

-- 

^ permalink raw reply	[flat|nested] 138+ messages in thread
* [PATCH 00/11] sysfs tagged directories V5
@ 2008-06-06 15:46 Benjamin Thery
  2008-06-06 15:48 ` [PATCH 07/11] sysfs: Implement sysfs_delete_link and sysfs_rename_link Benjamin Thery
  0 siblings, 1 reply; 138+ messages in thread
From: Benjamin Thery @ 2008-06-06 15:46 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Andrew Morton, Eric Biederman, Serge Hallyn, linux-kernel,
	Tejun Heo, Al Viro, Linux Containers, Benjamin Thery

Greg,

Here is an updated version of the sysfs tagged directories that improves
a bit the situation over the previous one. 

I've modified the patch 09 ("Enable tagging for net_class directories in 
sysfs") to be a bit less intrusive in sysfs core. I removed the #ifdef'd
parts you didn't like in fs/sysfs/mount.c, and replaced it by a generic 
routine sysfs_ns_exit() that is called, if needed, by the namespace when
it exits. This routine goes through every sysfs super blocks and calls 
the callback passed by the namespace to clean its tag.

The patch is now splitted in two: 
* 09/11: the generic routine,
* 10/11: the remaining network parts.

The generic part can be merge with patch 05 ("sysfs: Implement sysfs 
tagged directory support.") but I left it separate for now to ease 
reviews.

Serge's patch for user namespace is modified to use this new service too.
No more #ifdef CONFIG_NET or #ifdef CONFIG_USER_NS in fs/sysfs/mount.c 
now.


But, currently, a new namespace that wants to add its tag to sysfs dirs
still need to modify fs/sysfs/mount.c in a few routines to manage the
new tag member added in struct sysfs_tag_info: sysfs_fill_super(), 
sysfs_test_super(), sysfs_kill_sb() (see the last two patches).
These changes are only the initialization and a bunch of comparisons.

If we really want to go further, to get rid of these, I've thought 
about:

* Extending sysfs_tagged_dir_operations with super blocks operations: 
  - fill_sb_tag, test_sb_tag, kill_sb_tag

* Add routines in sysfs to allow registration/unregistration of these 
  operations structs in a list:
  - sysfs_register_tagged_dir_ops()...

* Each subsystem concerned implements and registers its operations at 
  boot.

* In sysfs_fill_super(), sysfs_test_super() and sysfs_kill_sb(), add 
  loops to go through all registered operations structs and calls the 
  corresponding operations if it's present.

But... I thought it was a bit overkill for the few namespaces that will 
actually need sysfs tagged directories.


(Below you'll find the traditional introduction for sysfs tagged dirs 
and the updated changelog)

Thanks,
Benjamin

--
Here is an updated version of Eric Biederman's patchset to implement
tagged directories in sysfs ported on top of 2.6.26-rc2-mm1.

With the introduction of network namespaces, there can be duplicate 
network interface names on the same machine. Indeed, two network 
interfaces can have the same name if they reside in different network
namespaces. 

* Network interfaces names show up in sysfs.
* Today there is nothing in sysfs that is currently per namespace.
* Therefore we need to support multiple mounts of sysfs each showing a 
  different network namespace.

We introduce tagged directories in sysfs for this purpose.

Of course the usefulness of this feature is not limited to network stuff:
Serge Hallyn wrote a patch to fix a similar issue with user namespaces based 
on this patchset. His patch is included at the end of the patchset.

Tested with and without SYSFS_DEPRECATED. No regression found so far.

Changelog
---------
* V5:
  - Make namespace tags a bit less intrusive in sysfs core:
    - New patch 09: Added a generic sysfs_ns_exit routine called by 
      exiting namespaces. A callback is passed to this routine to 
      execute the subsystem specific code.
    - Modified patches 09 and 10 (now 10 and 11) ("netns tagging" and 
      "userns tagging") to use this new routine instead of adding 
      #ifdef'd code in fs/sysfs/mount.c.
  - Added missing -ENOMEM in fs/sysfs/dir.c:prep_rename() (Roel Kluin)
* V4:
  - Ported to 2.6.26-rc2-mm1
  - Updated patch for user namespace by Serge Hallyn (patch 10).
* V3:
  - Removed patch 10 ("avoid kobject name conflict with different 
    namespaces"), a better one was provided by Eric.
  - Removed patch 11 ("sysfs: user namespaces: add ns to user_struct"),
    Serge needs to rework some parts of it.
  - Change Acked-by: to Signed-off-by:, someone told me it is more 
    appropriate (as I'm in the delivery path).


Here is the announcement Eric wrote back in December to introduce his 
patchset:

"
Now that we have network namespace support merged it is time to
revisit the sysfs support so we can remove the dependency on !SYSFS.
[...]
The bulk of the patches are the changes to allow multiple sysfs
superblocks.

Then comes the tagged directory sysfs support which uses information
captured at mount time to decide which object with which tag will
appear in a directory.

Then the support for renaming and deleting objects where the source
may be ambiguous because of tagging.

Then finally the network namespace support so it is clear how all
of this tied together.
"

Regards,
Benjamin

-- 

^ permalink raw reply	[flat|nested] 138+ messages in thread
* [RESEND][PATCH 00/11] sysfs tagged directories
@ 2008-05-06 17:30 Benjamin Thery
  2008-05-06 17:31 ` [PATCH 07/11] sysfs: Implement sysfs_delete_link and sysfs_rename_link Benjamin Thery
  0 siblings, 1 reply; 138+ messages in thread
From: Benjamin Thery @ 2008-05-06 17:30 UTC (permalink / raw)
  To: linux-kernel
  Cc: Eric W. Biederman, Tejun Heo, Greg Kroah-Hartman, Al Viro,
	Daniel Lezcano, Serge E. Hallyn, Pavel Emelyanov, netdev,
	Benjamin Thery

This is still the same port of Eric Biederman's patchset to implement
tagged directories in sysfs that was discussed a few days ago.

This time it applies on top of 2.6.26-rc1, 
which includes a fix from Daniel Lezcano to fix net device renaming
for sysfs (and of course all the network namespaces stuff that was 
committed in net-2.6.26).

This patchset still contains the patch from Serge Hallyn that implements
tagging for user namespaces.

It also contains a patch from Daniel Lezcano which allows to have net 
devices with the same name in two different network namespaces.


Here is what I said when I sent the patchset a few days ago:

> I re-post this patchset as most of network namespace work has been
> merged in net-2.6.26 and the issue is it is currently easy to test
> because of this missing piece.
> (today sysfs must be disabled to test netns).
>
>
>This feature is needed for network namespaces where we have to be able
>to have multiple network devices with the same name in different network
>namespaces. 
>
>On top of that, the final patch from Serge Hallyn also implements 
>tagging for user namespaces.
>
> Here is the announcement Eric wrote back in December to introduce his 
> patchset:

> "
> Now that we have network namespace support merged it is time to
> revisit the sysfs support so we can remove the dependency on !SYSFS.
> [...]
> The bulk of the patches are the changes to allow multiple sysfs
> superblocks.
>
> Then comes the tagged directory sysfs support which uses information
> captured at mount time to decide which object with which tag will
> appear in a directory.
>
> Then the support for renaming and deleting objects where the source
> may be ambiguous because of tagging.
>
> Then finally the network namespace support so it is clear how all
> of this tied together.
> "

Regards,
Benjamin
-- 

^ permalink raw reply	[flat|nested] 138+ messages in thread

end of thread, other threads:[~2008-10-14  3:30 UTC | newest]

Thread overview: 138+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-18 17:07 [PATCH 00/11] sysfs tagged directories V6 Benjamin Thery
2008-06-18 17:07 ` [PATCH 01/11] sysfs: Support for preventing unmounts Benjamin Thery
2008-06-18 17:44   ` Dave Hansen
2008-06-18 20:12     ` Eric W. Biederman
2008-06-19  8:54       ` Benjamin Thery
2008-06-19 16:32       ` Dave Hansen
2008-06-19 20:19         ` Benjamin Thery 
2008-06-18 17:07 ` [PATCH 02/11] sysfs: sysfs_get_dentry add a sb parameter Benjamin Thery
2008-06-18 17:07 ` [PATCH 03/11] sysfs: Implement __sysfs_get_dentry Benjamin Thery
2008-06-18 17:08 ` [PATCH 04/11] sysfs: Rename Support multiple superblocks Benjamin Thery
2008-06-18 17:08 ` [PATCH 05/11] sysfs: sysfs_chmod_file handle " Benjamin Thery
2008-06-22  4:46   ` Tejun Heo
2008-06-23 21:42     ` Daniel Lezcano
2008-06-24  4:45       ` Tejun Heo
2008-06-24 10:39         ` Daniel Lezcano
2008-06-24 13:37         ` Daniel Lezcano
2008-06-25 12:31           ` Tejun Heo
2008-06-18 17:08 ` [PATCH 06/11] sysfs: Implement sysfs tagged directory support Benjamin Thery
2008-06-23  2:05   ` Tejun Heo
2008-06-26 20:21     ` Eric W. Biederman
2008-06-29  3:51       ` Tejun Heo
2008-06-30 18:56         ` Eric W. Biederman
2008-06-30 21:44           ` Serge E. Hallyn
2008-07-01  7:50             ` Eric W. Biederman
2008-07-01  6:47           ` Tejun Heo
2008-07-01  9:20             ` Eric W. Biederman
2008-07-01 10:30               ` Tejun Heo
2008-07-01 12:30                 ` Eric W. Biederman
2008-07-02  3:24                   ` Tejun Heo
2008-07-02  3:53                     ` Eric W. Biederman
2008-07-02  4:37                       ` Tejun Heo
2008-07-02 16:49                         ` Eric W. Biederman
2008-07-03  0:15                           ` Greg KH
2008-07-03  3:18                           ` Tejun Heo
2008-07-03  5:11                             ` Eric W. Biederman
2008-07-03 10:56                               ` Daniel Lezcano
2008-07-03 12:27                                 ` Eric W. Biederman
2008-07-03 12:37                                   ` Benjamin Thery
2008-07-03 19:57                                     ` Eric W. Biederman
2008-07-03 12:55                                   ` Daniel Lezcano
2008-07-03 15:58                                   ` Tejun Heo
2008-07-03 18:29                                     ` Daniel Lezcano
2008-07-03 20:08                                     ` Eric W. Biederman
2008-07-04  0:48                                     ` [PATCH 00/15] sysfs support for namespaces Eric W. Biederman
2008-07-04  1:05                                       ` [PATCH 01/15] kobject: Cleanup kobject_rename and !CONFIG_SYSFS Eric W. Biederman
2008-07-04  1:07                                         ` [PATCH 02/15] sysfs: Support for preventing unmounts Eric W. Biederman
2008-07-04  1:08                                           ` [PATCH 03/15] sysfs: sysfs_get_dentry add a sb parameter Eric W. Biederman
2008-07-04  1:09                                             ` [PATCH 04/15] sysfs: Implement __sysfs_get_dentry Eric W. Biederman
2008-07-04  1:10                                               ` [PATCH 05/15] sysfs: Rename Support multiple superblocks Eric W. Biederman
2008-07-04  1:11                                                 ` [PATCH 06/15] Introduce sysfs_sd_setattr and fix sysfs_chmod Eric W. Biederman
2008-07-04  1:13                                                   ` [PATCH 07/15] sysfs: sysfs_chmod_file handle multiple superblocks Eric W. Biederman
2008-07-04  1:14                                                     ` [PATCH 08/15] sysfs: Make sysfs_mount static once again Eric W. Biederman
2008-07-04  1:16                                                       ` [PATCH 09/15] sysfs: Implement sysfs tagged directory support Eric W. Biederman
2008-07-04  1:17                                                         ` [PATCH 10/15] sysfs: Merge sysfs_rename_dir and sysfs_move_dir Eric W. Biederman
2008-07-04  1:18                                                           ` [PATCH 11/15] sysfs: Implement sysfs_delete_link and sysfs_rename_link Eric W. Biederman
2008-07-04  1:20                                                             ` [PATCH 12/15] driver core: Implement tagged directory support for device classes Eric W. Biederman
2008-07-04  1:21                                                               ` [PATCH 13/15] Revert "netns: Fix device renaming for sysfs" Eric W. Biederman
2008-07-04  1:22                                                                 ` [PATCH 14/15] netns: Enable tagging for net_class directories in sysfs Eric W. Biederman
2008-07-04  1:23                                                                   ` [PATCH 15/15] sysfs: user namespaces: fix bug with clone(CLONE_NEWUSER) with fairsched Eric W. Biederman
2008-07-04  7:50                                                               ` [PATCH 12/15] driver core: Implement tagged directory support for device classes Tejun Heo
2008-07-04 13:31                                                                 ` Eric W. Biederman
2008-07-04 13:57                                                                   ` Tejun Heo
2008-07-04 16:12                                                                     ` Greg KH
2008-07-04 21:49                                                                       ` Eric W. Biederman
2008-07-14  1:54                                                                       ` Eric W. Biederman
2008-07-16  3:25                                                                         ` Tejun Heo
2008-07-16  5:41                                                                           ` Eric W. Biederman
2008-07-16  5:50                                                                             ` Tejun Heo
2008-07-16  6:32                                                                               ` Eric W. Biederman
2008-07-16  6:48                                                                                 ` Tejun Heo
2008-07-16  7:02                                                                                   ` Tejun Heo
2008-07-16 19:07                                                                                     ` Eric W. Biederman
2008-07-16 21:09                                                                                   ` Eric W. Biederman
2008-07-17 23:08                                                                           ` Greg KH
2008-07-18 12:41                                                                             ` Tejun Heo
2008-07-18 18:49                                                                               ` Greg KH
2008-07-18 20:19                                                                                 ` Eric W. Biederman
2008-07-19  1:07                                                                                 ` Tejun Heo
2008-08-03  6:59                                                                                 ` Eric W. Biederman
2008-09-11 12:45                                                                                   ` Jiri Slaby
2008-09-11 13:05                                                                                     ` Benjamin Thery
2008-09-12  6:32                                                                                       ` Jiri Slaby
2008-07-04 22:00                                                                     ` Eric W. Biederman
2008-08-20  2:17                                                         ` [PATCH 09/15] sysfs: Implement sysfs tagged directory support Greg KH
2008-08-20  6:58                                                           ` Eric W. Biederman
2008-08-21  6:31                                                           ` [PATCH 0/8] sysfs namespace support Eric W. Biederman
2008-08-21  6:33                                                             ` [PATCH 1/8] sysfs: Implement sysfs tagged directory support Eric W. Biederman
2008-08-21  6:34                                                               ` [PATCH 2/8] sysfs: Merge sysfs_rename_dir and sysfs_move_dir Eric W. Biederman
2008-08-21  6:35                                                                 ` [PATCH 3/8] sysfs: Implement sysfs_delete_link and sysfs_rename_link Eric W. Biederman
2008-08-21  6:36                                                                   ` [PATCH 5/8] sysfs: Remove sysfs_create_link_nowarn Eric W. Biederman
2008-08-21  6:38                                                                     ` [PATCH 6/8] Revert "netns: Fix device renaming for sysfs" Eric W. Biederman
2008-08-21  6:39                                                                       ` [PATCH 7/8] netns: Enable tagging for net_class directories in sysfs Eric W. Biederman
2008-08-21  6:40                                                                         ` [PATCH 8/8] sysfs: user namespaces: fix bug with clone(CLONE_NEWUSER) with fairsched Eric W. Biederman
2008-08-21  6:47                                                                         ` [PATCH 7/8] netns: Enable tagging for net_class directories in sysfs David Miller
2008-08-21  6:47                                                                       ` [PATCH 6/8] Revert "netns: Fix device renaming for sysfs" David Miller
2008-08-21  6:37                                                                   ` [PATCH 4/8] driver core: Implement tagged directory support for device classes Eric W. Biederman
2008-08-27 15:18                                                               ` [PATCH 1/8] sysfs: Implement sysfs tagged directory support Benjamin Thery
2008-09-02 13:54                                                                 ` Mark Ryden
2008-09-02 14:03                                                                   ` Benjamin Thery
2008-09-02 17:01                                                                     ` Greg KH
2008-09-04  5:33                                                                       ` David Shwatrz
2008-09-04  6:44                                                                         ` Benjamin Thery
2008-09-08 18:39                                                                           ` Mark Ryden
2008-10-07 16:39                                                                           ` Mark Ryden
2008-10-07 16:48                                                                             ` Greg KH
2008-10-07 20:31                                                                               ` Eric W. Biederman
2008-10-07 21:09                                                                                 ` Greg KH
2008-10-07 22:27                                                                                   ` Eric W. Biederman
2008-10-08 13:00                                                                                     ` Christoph Hellwig
2008-10-14  3:20                                                                                       ` Eric W. Biederman
2008-10-07 16:52                                                                             ` Daniel Lezcano
2008-08-21  6:37                                                             ` [PATCH 0/8] sysfs namespace support David Miller
2008-07-04  6:44                                                       ` [PATCH 08/15] sysfs: Make sysfs_mount static once again Tejun Heo
2008-07-04  6:44                                                     ` [PATCH 07/15] sysfs: sysfs_chmod_file handle multiple superblocks Tejun Heo
2008-07-04  6:40                                                   ` [PATCH 06/15] Introduce sysfs_sd_setattr and fix sysfs_chmod Tejun Heo
2008-07-04  6:33                                         ` [PATCH 01/15] kobject: Cleanup kobject_rename and !CONFIG_SYSFS Tejun Heo
2008-07-04  1:27                                       ` [PATCH 00/15] sysfs support for namespaces Eric W. Biederman
2008-07-06  4:42                                       ` Eric W. Biederman
2008-07-07 11:41                                         ` Cornelia Huck
2008-07-07 12:22                                           ` Eric W. Biederman
2008-06-18 17:08 ` [PATCH 07/11] sysfs: Implement sysfs_delete_link and sysfs_rename_link Benjamin Thery
2008-06-23  2:13   ` Tejun Heo
2008-06-26 20:24     ` Eric W. Biederman
2008-06-29  3:35       ` Tejun Heo
2008-06-30  3:02         ` Eric W. Biederman
2008-06-18 17:08 ` [PATCH 08/11] driver core: Implement tagged directory support for device classes Benjamin Thery
2008-06-18 17:08 ` [PATCH 09/11] sysfs: add sysfs_ns_exit routine Benjamin Thery
2008-06-18 20:19   ` Eric W. Biederman
2008-06-23  2:16   ` Tejun Heo
2008-06-18 17:09 ` [PATCH 10/11] netns: Enable tagging for net_class directories in sysfs Benjamin Thery
2008-06-23  2:18   ` Tejun Heo
2008-06-18 17:09 ` [PATCH 11/11] sysfs: user namespaces: fix bug with clone(CLONE_NEWUSER) with fairsched Benjamin Thery
2008-06-23  2:18   ` Tejun Heo
2008-06-25 18:44     ` Serge E. Hallyn
2008-06-25 21:11       ` Eric W. Biederman
2008-06-26 13:07         ` Serge E. Hallyn
  -- strict thread matches above, loose matches on Subject: below --
2008-06-06 15:46 [PATCH 00/11] sysfs tagged directories V5 Benjamin Thery
2008-06-06 15:48 ` [PATCH 07/11] sysfs: Implement sysfs_delete_link and sysfs_rename_link Benjamin Thery
2008-05-06 17:30 [RESEND][PATCH 00/11] sysfs tagged directories Benjamin Thery
2008-05-06 17:31 ` [PATCH 07/11] sysfs: Implement sysfs_delete_link and sysfs_rename_link Benjamin Thery

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).