Commit 35f209ff authored by Dmitry Safonov's avatar Dmitry Safonov Committed by Pavel Emelyanov

fault: add dump pages fault for parasite_dump_pages_seized

Parasite should cleanup after fauilure and remove read-protection
from VMAs. Check it with maps00 test & fault injection.

Tested on travis with some addition:
python test/zdtm.py run -t zdtm/static/maps00 --fault 3 --keep-going --report report -f h || false
https://travis-ci.org/0x7f454c46/criu/jobs/119252291

Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 05880800
......@@ -6,6 +6,7 @@ enum faults {
FI_NONE = 0,
FI_DUMP_EARLY,
FI_RESTORE_ROOT_ONLY,
FI_DUMP_PAGES,
/* not fatal */
FI_CHECK_OPEN_HANDLE = 128,
FI_NO_MEMFD = 129,
......
......@@ -20,6 +20,7 @@
#include "restorer.h"
#include "files-reg.h"
#include "pagemap-cache.h"
#include "fault-injection.h"
#include "protobuf.h"
#include "images/pagemap.pb-c.h"
......@@ -370,9 +371,18 @@ int parasite_dump_pages_seized(struct parasite_ctl *ctl,
return ret;
}
if (fault_injected(FI_DUMP_PAGES)) {
pr_err("fault: Dump VMA pages failure!\n");
return -1;
}
ret = __parasite_dump_pages_seized(ctl, pargs, vma_area_list, pp);
if (ret)
if (ret) {
pr_err("Can't dump page with parasite\n");
/* Parasite will unprotect VMAs after fail in fini() */
return ret;
}
pargs->add_prot = 0;
if (parasite_execute_daemon(PARASITE_CMD_MPROTECT_VMAS, ctl)) {
......
......@@ -4,5 +4,6 @@ source `dirname $0`/criu-lib.sh
prep
./test/zdtm.py run -t zdtm/static/env00 --fault 1 --keep-going --report report -f h || fail
./test/zdtm.py run -t zdtm/static/unlink_fstat00 --fault 2 --keep-going --report report -f h || fail
./test/zdtm.py run -t zdtm/static/maps00 --fault 3 --keep-going --report report -f h || fail
./test/zdtm.py run -t zdtm/static/inotify_irmap --fault 128 --keep-going --pre 2 -f uns || fail
./test/zdtm.py run -t zdtm/static/env00 --fault 129 -f uns || fail
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment