[CRIU] [PATCH v3 0/5] support restoring ghost files on readonly mounts

Pavel Tikhomirov ptikhomirov at virtuozzo.com
Thu Sep 27 12:17:31 MSK 2018


We have a problem restoring ghost-files on readonly mounts:

Failed to resume the CT: PRL_ERR_VZCTL_OPERATION_FAILED (Details: (04.800253)      1: Error (criu/files-reg.c:381): Can't create ghost regfile: Read-only file system
(04.916178) Error (criu/files-reg.c:868): Couldn't unlink remap 17 lib/x86_64-linux-gnu/libm-2.24.so.dpkg-new.cr.22.ghost: Read-only file system
(04.916190) Error (criu/files-reg.c:868): Couldn't unlink remap 17 lib/x86_64-linux-gnu/libm-2.24.so.dpkg-new.cr.22.ghost: No such file or directory
(04.945551) Error (criu/cr-restore.c:2340): Restoring FAILED.

First improve mnt_is_overmounted helper to use it safely after
mounts remap.

Second actually fix the problem by making mounts writable (where
possible) while restoring files.

Just to note: I thought about two other possible ways of making these
work: Find a writable bind-mount - but there can be no such a thing, see
the third (test) patch. Remount the mount writable just before creating
ghosts and remount it back after it - we operate ghosts in three places
(create, give it the right name, remove) so these approach brings a lot
of extra remounts and is hardly a good way.

While on it add a check for unsupported open files on overmounted mounts
early on dump, which also implies ghost-files.

Pavel Tikhomirov (5):
  mount: save the result of mnt_is_overmounted
  mount: delay restoring readonly mount flag until all files ready
  zdtm: ghost on readonly fs
  files: open files on overmounted mounts are not supported
  zdtm: test dumping file on overmounted mount fails

 criu/cr-restore.c                      |   2 +
 criu/files-reg.c                       |  13 +-
 criu/include/mount.h                   |   5 +
 criu/mount.c                           | 146 ++++++++++++++++++--
 test/zdtm/static/Makefile              |   2 +
 test/zdtm/static/ghost_on_rofs.c       | 179 +++++++++++++++++++++++++
 test/zdtm/static/ghost_on_rofs.desc    |   1 +
 test/zdtm/static/overmounted_file.c    | 109 +++++++++++++++
 test/zdtm/static/overmounted_file.desc |   1 +
 9 files changed, 446 insertions(+), 12 deletions(-)
 create mode 100644 test/zdtm/static/ghost_on_rofs.c
 create mode 100644 test/zdtm/static/ghost_on_rofs.desc
 create mode 100644 test/zdtm/static/overmounted_file.c
 create mode 100644 test/zdtm/static/overmounted_file.desc

-- 
2.17.1



More information about the CRIU mailing list