Commit 93e92223 authored by Andrew Vagin's avatar Andrew Vagin Committed by Pavel Emelyanov

criu: check that ghost files are cleaned up in error cases

Signed-off-by: 's avatarAndrew Vagin <avagin@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 10af342f
......@@ -27,6 +27,7 @@
#include "namespaces.h"
#include "proc_parse.h"
#include "pstree.h"
#include "fault-injection.h"
#include "protobuf.h"
#include "images/regfile.pb-c.h"
......@@ -1396,6 +1397,11 @@ int open_path(struct file_desc *d,
}
if (rfi->remap) {
if (fault_injected(FI_RESTORE_OPEN_LINK_REMAP)) {
pr_info("fault: Open link-remap failure!\n");
BUG();
}
mutex_lock(ghost_file_mutex);
if (rfi->remap->is_dir) {
/*
......
......@@ -7,6 +7,7 @@ enum faults {
FI_DUMP_EARLY,
FI_RESTORE_ROOT_ONLY,
FI_DUMP_PAGES,
FI_RESTORE_OPEN_LINK_REMAP,
/* not fatal */
FI_CHECK_OPEN_HANDLE = 128,
FI_NO_MEMFD = 129,
......
......@@ -9,3 +9,6 @@ prep
./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
./test/zdtm.py run -t zdtm/transition/fork --fault 130 -f h || fail
./test/zdtm.py run -t zdtm/static/mntns_ghost --fault 2 --keep-going --report report || fail
./test/zdtm.py run -t zdtm/static/mntns_ghost --fault 4 --keep-going --report report || 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