sk-unix: Handle bindmounted dgram sockets

Submitted by Cyrill Gorcunov on Aug. 8, 2017, 11:25 a.m.

Details

Reviewer None
Submitted Aug. 8, 2017, 11:25 a.m.
Last Updated Aug. 8, 2017, 11:07 p.m.
Revision 1

Cover Letter

We've discovered a situation where socket is bindmounted inside
container (mysql daemon uses /dev/log bindmounted) so restore
procedure may fail because sockets are opened later than mount
engine is trying to bindmount.

For this sake we detect such situstion on dump and use fdstore
engine to open a socket needed before mount call.

https://jira.sw.ru/browse/PSBM-69473

Cyrill Gorcunov (4):
  sk-unix: Save mnt_id for bindmounted entries
  mount: Export print_ns_root
  sk-unix: Handle bindmounted dgram sockets on restore
  test: mount -- Add bind-mount-unix

 criu/cr-dump.c                        |   3 +
 criu/include/mount.h                  |   1 +
 criu/include/sockets.h                |   3 +
 criu/mount.c                          |  10 ++-
 criu/sk-unix.c                        | 122 ++++++++++++++++++++++++++++++++++
 images/sk-unix.proto                  |   5 ++
 test/zdtm/static/Makefile             |   1 +
 test/zdtm/static/bind-mount-unix.c    | 106 +++++++++++++++++++++++++++++
 test/zdtm/static/bind-mount-unix.desc |   1 +
 9 files changed, 250 insertions(+), 2 deletions(-)
 create mode 100644 test/zdtm/static/bind-mount-unix.c
 create mode 100644 test/zdtm/static/bind-mount-unix.desc
  

Revisions