[CRIU] [PATCH RFC 00/16] Open files in proper namespaces

Andrey Vagin avagin at openvz.org
Tue Apr 8 16:34:52 PDT 2014


Recently the mnt_id field was added in /proc/PID/fdinfo/X.
It allows us to know from which mount a file has been opened.
It's significant, if a few mount namespaces are restored.

Now mnt_id is saved for each file and on restore files are opened in
proper mount namespaces.

Andrey Vagin (16):
  proc_parse: parse fdinfo to get pos and flags
  proc_parse: parse mnt_id from /proc/PID/fdinfo/FD
  namespaces: dump mount namespaces before tasks
  mount: save mount tree for each namespace
  files: save mnt_id on fd_param
  files: save mnt_id for reg files
  fix mount: save mount tree for each namespace
  files-ids: generate id-s accoding with mnt_id, st->st_dev and
    st->st_ino
  servicefd: add a service fd for current root
  restore: look up root for each file
  zdtm: mark all mounts as private for one call
  zdtm: reexec the mountpoints test in a target mntns
  files: open ghost file relative to the proper root
  zdtm: check opened files in a second mntns
  mount: print error message if readlinkat failed
  mount: add a fast path for mntns_collect_root

 cr-dump.c                           | 55 +++++++++++++++++++++-------
 cr-restore.c                        |  3 ++
 file-ids.c                          | 32 ++++++++++-------
 files-reg.c                         | 38 ++++++++++++++++++--
 files.c                             | 17 ++++-----
 include/file-ids.h                  |  5 +--
 include/files.h                     |  2 ++
 include/mount.h                     |  6 +++-
 include/namespaces.h                |  9 ++++-
 include/proc_parse.h                |  7 ++++
 include/servicefd.h                 |  1 +
 mount.c                             | 71 ++++++++++++++++++++++++++++++++++---
 namespaces.c                        | 68 ++++++++++++++++++++---------------
 proc_parse.c                        | 25 ++++++++++++-
 protobuf/regfile.proto              |  1 +
 test/zdtm.sh                        |  1 +
 test/zdtm/lib/test.c                | 18 ++++++----
 test/zdtm/live/static/mountpoints.c | 50 +++++++++++++++++---------
 18 files changed, 310 insertions(+), 99 deletions(-)

-- 
1.8.5.3



More information about the CRIU mailing list