[CRIU] [PATCH 0/2] support restoring ghost files on readonly mounts
Andrew Vagin
avagin at virtuozzo.com
Wed Sep 12 02:54:32 MSK 2018
Pavel, I have modified your test and criu restore failed. It is always bad, all
errors have to be reported on dump.
[root at fc24 criu]# git diff
diff --git a/test/zdtm/static/ghost_on_rofs.c b/test/zdtm/static/ghost_on_rofs.c
index 6362e8334..32966f910 100644
--- a/test/zdtm/static/ghost_on_rofs.c
+++ b/test/zdtm/static/ghost_on_rofs.c
@@ -131,6 +131,10 @@ int main(int argc, char **argv)
pr_perror("mount");
return 1;
}
+ if (mount("ro_mount", dirname, "tmpfs", 0, NULL)) {
+ pr_perror("mount");
+ return 1;
+ }
test_daemon();
test_waitsig();
@@ -158,6 +162,10 @@ int main(int argc, char **argv)
close(fd);
close(fd_bind);
+ if (umount(dirname)) {
+ pr_perror("Unable to umount %s", ro_mount);
+ return 1;
+ }
if (umount(ro_bind_mount)) {
pr_perror("Unable to umount %s", ro_bind_mount);
return 1;
[root at fc24 criu]# python test/zdtm.py run -t zdtm/static/ghost_on_rofs --sbs
=== Run 1/1 ================ zdtm/static/ghost_on_rofs
===================== Run zdtm/static/ghost_on_rofs in ns ======================
DEP ghost_on_rofs.d
CC ghost_on_rofs.o
LINK ghost_on_rofs
Start test
Test is SUID
./ghost_on_rofs --pidfile=ghost_on_rofs.pid --outfile=ghost_on_rofs.out --dirname=ghost_on_rofs.test
Pause at pre-dump. Press Enter to continue.
Run criu dump
files stat: fs/file-max 400660, fs/nr_open 1048576
rlimit: RLIMIT_NOFILE unlimited for self
Loaded kdat cache from /run/criu.kdat
Pause at pre-restore. Press Enter to continue.Run criu restore
files stat: fs/file-max 400660, fs/nr_open 1048576
rlimit: RLIMIT_NOFILE unlimited for self
Loaded kdat cache from /run/criu.kdat
=[log]=> dump/zdtm/static/ghost_on_rofs/70/1/restore.log
------------------------ grep Error ------------------------
(00.384819) pie: 4: vdso: Remap rt-vdso 0x2b000 -> 0x7ffc4c4ff000
(00.384832) pie: 4: vdso: Remap rt-vvar 0x28000 -> 0x7ffc4c4fc000
(00.384882) pie: 4: Restoring scheduler params 0.0.0
(00.384927) pie: 4: 4: Restored
(00.385068) 1: mnt: Switched to mntns 12:0/n(00.385104) 1: Error (criu/mount.c:3702): mnt: Failed to restore 195:/tmp/.criu.mntns.d8M3QA/12-0000000000/zdtm/static/ghost_on_rofs.test/ro_mount mount flags 300001: No such file or directory
(00.385163) 1: Error (criu/mount.c:3764): mnt: Can't wait or bad status: errno=0, status=256
(00.403322) Error (criu/cr-restore.c:1428): 97 exited, status=1
(00.403378) Warn (criu/cr-restore.c:2294): Unable to wait 97: No child processes
(00.403390) mnt: Switching to new ns to clean ghosts
(00.403490) Unlink remap zdtm/static/ghost_on_rofs.test/ghost_file.cr.1.ghost
(00.403543) Unlink remap zdtm/static/ghost_on_rofs.test/ghost_file_bind.cr.2.ghost
(00.419163) Error (criu/cr-restore.c:2308): Restoring FAILED.
------------------------ ERROR OVER ------------------------
############# Test zdtm/static/ghost_on_rofs FAIL at CRIU restore ##############
##################################### FAIL #####################################
On Tue, Sep 11, 2018 at 06:53:29PM +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.
>
> See description of the first patch for explanation of the fix.
>
> 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 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.
>
> https://jira.sw.ru/browse/PSBM-82991
>
> Pavel Tikhomirov (2):
> mount: delay restoring readonly mount flag untill all files ready
> zdtm: ghost on readonly fs
>
> criu/cr-restore.c | 2 +
> criu/include/mount.h | 2 +
> criu/mount.c | 112 ++++++++++++++++-
> test/zdtm/static/Makefile | 1 +
> test/zdtm/static/ghost_on_rofs.c | 179 ++++++++++++++++++++++++++++
> test/zdtm/static/ghost_on_rofs.desc | 1 +
> 6 files changed, 295 insertions(+), 2 deletions(-)
> create mode 100644 test/zdtm/static/ghost_on_rofs.c
> create mode 100644 test/zdtm/static/ghost_on_rofs.desc
>
> --
> 2.17.1
>
More information about the CRIU
mailing list