[CRIU] [PATCH v4 0/7] support restoring ghost files on readonly mounts

Andrei Vagin avagin at gmail.com
Mon Feb 11 20:53:49 MSK 2019


Applied, thanks!

On Thu, Dec 13, 2018 at 12:02:49PM +0300, Pavel Tikhomirov wrote:
> 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 prepare do_restore_task_mnt_ns to be used in next patches.
> 
> Second improve mnt_is_overmounted helper to use it safely after
> mounts remap.
> 
> Third actually fix the problem by making mounts writable just before
> restore wants to do any operations on them while restoring files, and
> later remount them back where needed.
> 
> Just to note: I thought/tried two other possible ways of making these
> work: 1) Find a writable bind-mount - but there can be no such a thing, see
> the (test) patch 4. 2) Remount all mounts writable initially, these way
> we can do a lot of extra remounts while having no ghost-files, that's
> bad. 3) Make all ghost operations in service mntns, but that looks too
> complicated.
> 
> While on it add a check for unsupported open files on overmounted mounts
> early on dump, which also implies ghost-files.
> 
> Also add a check that mount flags restore fine in zdtm, so that we can
> be sure these patchset does not break threm.
> 
> Pavel Tikhomirov (7):
>   mount: remove unused argument of do_restore_task_mnt_ns
>   mount: save the result of mnt_is_overmounted
>   mount: remount ro mounts writable before ghost-file restore
>   zdtm: ghost on readonly fs
>   files: open files on overmounted mounts are not supported
>   zdtm: test dumping file on overmounted mount fails
>   zdtm.py: also check that mount flags are restored correct
> 
>  criu/cr-restore.c                      |   3 +
>  criu/files-reg.c                       |  38 +++++-
>  criu/include/mount.h                   |  19 +++
>  criu/mount.c                           | 175 ++++++++++++++++++++++--
>  test/zdtm.py                           |   2 +-
>  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 +
>  10 files changed, 513 insertions(+), 16 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