Add /proc/[pid]/ns/pid_for_children ns support (and fixes)

Submitted by Kirill Tkhai on May 23, 2017, 12:38 p.m.

Details

Reviewer None
Submitted May 23, 2017, 12:38 p.m.
Last Updated June 1, 2017, 5:42 a.m.
Revision 4

Cover Letter

Hi, this is the second version of pid_for_children patchset for new kernel functionality:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=eaa0d190bfe1ed891b814a52712dcd852554cb08

Changes in comparation to v1 are in [1,4,10/21]. Also, it's rebased on fresh criu-dev.

---

Kirill Tkhai (21):
      zdtm: Make possible to claim for features list
      pstree: Add helpers for ordered linking child task to parent
      zdtm: Add pidns02 test (test on zombies)
      ns: Move forked task user_ns assignment
      restore: Convert waited helpers and zombies pids in parent's pid_ns
      restore: Make error path in restore_root_task() accurate
      dump: More obvious assignment of top_pid_ns
      kerndat: Check for /proc/[pid]/ns/pid_for_children_ns
      img: Add pid_for_children_ns_id description
      ns: Add possibility to read a ns by alternative name in __get_ns_id()
      ns: Add alternative name for pid namespace
      ns: Make possible to avoid NS_ROOT assignment
      ns: Use alternative name in set_ns_hookups() if need
      ns: Collect/read pid_for_children ns
      pstree: Dump threads pid_for_children_ns
      ns: Fixup pid_for_children_ns of threads
      fork: Move ns-specific code to setup_child_task_namespaces()
      fork: Delete pid argument of set_pid_for_children_ns()
      ns: First stage of restore pid_for_children ns
      ns: Restore pid_for_children ns in threads
      zdtm: Add pidns03 test


 criu/cgroup.c                 |    2 
 criu/cr-check.c               |   12 ++
 criu/cr-dump.c                |   49 +++++++++-
 criu/cr-restore.c             |  140 ++++++++++++++++++++++-------
 criu/include/kerndat.h        |    2 
 criu/include/namespaces.h     |    7 +
 criu/include/pstree.h         |    1 
 criu/include/restorer.h       |    1 
 criu/ipc_ns.c                 |    2 
 criu/kerndat.c                |   17 +++
 criu/mount.c                  |    2 
 criu/namespaces.c             |   66 ++++++++++----
 criu/net.c                    |    2 
 criu/pie/restorer.c           |   33 ++++++-
 criu/pstree.c                 |   50 +++++++++-
 criu/uts_ns.c                 |    2 
 images/core.proto             |    1 
 test/zdtm.py                  |    9 +-
 test/zdtm/static/Makefile     |    5 +
 test/zdtm/static/pidns02.c    |  180 +++++++++++++++++++++++++++++++++++++
 test/zdtm/static/pidns02.desc |    1 
 test/zdtm/static/pidns03.c    |  200 +++++++++++++++++++++++++++++++++++++++++
 test/zdtm/static/pidns03.desc |    1 
 23 files changed, 715 insertions(+), 70 deletions(-)
 create mode 100644 test/zdtm/static/pidns02.c
 create mode 100644 test/zdtm/static/pidns02.desc
 create mode 100644 test/zdtm/static/pidns03.c
 create mode 100644 test/zdtm/static/pidns03.desc

--
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
  

Revisions

SERIES REVISION LOOKS STRANGE. Please double-check patch list and the ordering before proceeding.

Patches download mbox

# Name Submitter State
[01/21] zdtm: Make possible to claim for features list Kirill Tkhai New
[02/21] pstree: Add helpers for ordered linking child task to parent Kirill Tkhai New
[03/21] zdtm: Add pidns02 test (test on zombies) Kirill Tkhai New
[04/21] ns: Fix forked task user_ns assignment Kirill Tkhai New
[05/21] restore: Convert waited helpers and zombies pids in parent's pid_ns Kirill Tkhai New
[06/21] restore: Make error path in restore_root_task() accurate Kirill Tkhai New
[07/21] dump: More obvious assignment of top_pid_ns Kirill Tkhai New
[08/21] kerndat: Check for /proc/[pid]/ns/pid_for_children_ns Kirill Tkhai New
[09/21] img: Add pid_for_children_ns_id description Kirill Tkhai New
[10/21] ns: Add possibility to read a ns by alternative name in __get_ns_id() Kirill Tkhai New
[11/21] ns: Add alternative name for pid namespace Kirill Tkhai New
[12/21] ns: Make possible to avoid NS_ROOT assignment Kirill Tkhai New
[13/21] ns: Use alternative name in set_ns_hookups() if need Kirill Tkhai New
[14/21] ns: Collect/read pid_for_children ns Kirill Tkhai New
[15/21] pstree: Dump threads pid_for_children_ns Kirill Tkhai New
[16/21] ns: Fixup pid_for_children_ns of threads Kirill Tkhai Accepted
[17/21] fork: Move ns-specific code to setup_child_task_namespaces() Kirill Tkhai Accepted
[18/21] fork: Delete pid argument of set_pid_for_children_ns() Kirill Tkhai Accepted
[19/21] ns: First stage of restore pid_for_children ns Kirill Tkhai Accepted
[20/21] ns: Restore pid_for_children ns in threads Kirill Tkhai Accepted
[21/21] zdtm: Add pidns03 test Kirill Tkhai New
SERIES REVISION LOOKS STRANGE. Please double-check patch list and the ordering before proceeding.

Patches download mbox

# Name Submitter State
[01/21] zdtm: Make possible to claim for features list Kirill Tkhai New
[02/21] pstree: Add helpers for ordered linking child task to parent Kirill Tkhai New
[03/21] zdtm: Add pidns02 test (test on zombies) Kirill Tkhai New
[04/21] ns: Fix forked task user_ns assignment Kirill Tkhai New
[05/21] restore: Convert waited helpers and zombies pids in parent's pid_ns Kirill Tkhai New
[06/21] restore: Make error path in restore_root_task() accurate Kirill Tkhai New
[07/21] dump: More obvious assignment of top_pid_ns Kirill Tkhai New
[08/21] kerndat: Check for /proc/[pid]/ns/pid_for_children_ns Kirill Tkhai New
[09/21] img: Add pid_for_children_ns_id description Kirill Tkhai New
[10/21] ns: Add possibility to read a ns by alternative name in __get_ns_id() Kirill Tkhai New
[11/21] ns: Add alternative name for pid namespace Kirill Tkhai New
[12/21] ns: Make possible to avoid NS_ROOT assignment Kirill Tkhai New
[13/21] ns: Use alternative name in set_ns_hookups() if need Kirill Tkhai New
[14/21] ns: Collect/read pid_for_children ns Kirill Tkhai New
[15/21] pstree: Dump threads pid_for_children_ns Kirill Tkhai New
[16/21] ns: Fixup pid_for_children_ns of threads Kirill Tkhai Accepted
[17/21] fork: Move ns-specific code to setup_child_task_namespaces() Kirill Tkhai Accepted
[18/21] fork: Delete pid argument of set_pid_for_children_ns() Kirill Tkhai Accepted
[19/21] ns: First stage of restore pid_for_children ns Kirill Tkhai Accepted
[20/21] ns: Restore pid_for_children ns in threads Kirill Tkhai Accepted
[21/21] zdtm: Add pidns03 test Kirill Tkhai New

Tests

SERIES REVISION LOOKS STRANGE. Please double-check patch list and the ordering before proceeding.

Patches download mbox

# Name Submitter State
[01/21] zdtm: Make possible to claim for features list Kirill Tkhai New
[02/21] pstree: Add helpers for ordered linking child task to parent Kirill Tkhai New
[03/21] zdtm: Add pidns02 test (test on zombies) Kirill Tkhai New
[04/21] ns: Fix forked task user_ns assignment Kirill Tkhai New
[05/21] restore: Convert waited helpers and zombies pids in parent's pid_ns Kirill Tkhai New
[06/21] restore: Make error path in restore_root_task() accurate Kirill Tkhai New
[07/21] dump: More obvious assignment of top_pid_ns Kirill Tkhai New
[08/21] kerndat: Check for /proc/[pid]/ns/pid_for_children_ns Kirill Tkhai New
[09/21] img: Add pid_for_children_ns_id description Kirill Tkhai New
[10/21] ns: Add possibility to read a ns by alternative name in __get_ns_id() Kirill Tkhai New
[11/21] ns: Add alternative name for pid namespace Kirill Tkhai New
[12/21] ns: Make possible to avoid NS_ROOT assignment Kirill Tkhai New
[13/21] ns: Use alternative name in set_ns_hookups() if need Kirill Tkhai New
[14/21] ns: Collect/read pid_for_children ns Kirill Tkhai New
[15/21] pstree: Dump threads pid_for_children_ns Kirill Tkhai New
[16/21] ns: Fixup pid_for_children_ns of threads Kirill Tkhai Accepted
[17/21] fork: Move ns-specific code to setup_child_task_namespaces() Kirill Tkhai Accepted
[18/21] fork: Delete pid argument of set_pid_for_children_ns() Kirill Tkhai Accepted
[19/21] ns: First stage of restore pid_for_children ns Kirill Tkhai Accepted
[20/21] ns: Restore pid_for_children ns in threads Kirill Tkhai Accepted
[21/21] zdtm: Add pidns03 test Kirill Tkhai New

Tests

SERIES REVISION LOOKS STRANGE. Please double-check patch list and the ordering before proceeding.

Patches download mbox

# Name Submitter State
[v2,01/21] zdtm: Make possible to claim for features list Kirill Tkhai Accepted
[v2,02/21] pstree: Add helpers for ordered linking child task to parent Kirill Tkhai Accepted
[v2,03/21] zdtm: Add pidns02 test (test on zombies) Kirill Tkhai Accepted
[v2,04/21] ns: Move forked task user_ns assignment Kirill Tkhai Accepted
[v2,05/21] restore: Convert waited helpers and zombies pids in parent's pid_ns Kirill Tkhai Accepted
[v2,06/21] restore: Make error path in restore_root_task() accurate Kirill Tkhai Accepted
[v2,07/21] dump: More obvious assignment of top_pid_ns Kirill Tkhai Accepted
[v2,08/21] kerndat: Check for /proc/[pid]/ns/pid_for_children_ns Kirill Tkhai Accepted
[v2,09/21] img: Add pid_for_children_ns_id description Kirill Tkhai Accepted
[v2,10/21] ns: Add possibility to read a ns by alternative name in __get_ns_id() Kirill Tkhai Accepted
[v2,11/21] ns: Add alternative name for pid namespace Kirill Tkhai Accepted
[v2,12/21] ns: Make possible to avoid NS_ROOT assignment Kirill Tkhai Accepted
[v2,13/21] ns: Use alternative name in set_ns_hookups() if need Kirill Tkhai Accepted
[v2,14/21] ns: Collect/read pid_for_children ns Kirill Tkhai Accepted
[v2,15/21] pstree: Dump threads pid_for_children_ns Kirill Tkhai Accepted
[v2,16/21] ns: Fixup pid_for_children_ns of threads Kirill Tkhai Accepted
[v2,17/21] fork: Move ns-specific code to setup_child_task_namespaces() Kirill Tkhai Accepted
[v2,18/21] fork: Delete pid argument of set_pid_for_children_ns() Kirill Tkhai Accepted
[v2,19/21] ns: First stage of restore pid_for_children ns Kirill Tkhai Accepted
[v2,20/21] ns: Restore pid_for_children ns in threads Kirill Tkhai Accepted
[v2,21/21] zdtm: Add pidns03 test Kirill Tkhai Accepted

Tests