Commit 9c26bae0 authored by Andrei Vagin's avatar Andrei Vagin Committed by Pavel Emelyanov

fault: check link_remaps if the restore fails at the last moment

link-remap files has to be deleted only if processes have been
restored successfully. Otherwise we can want to repeat an attempt,
but it is imposible if some link-remap files were deleted.
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent f85a0448
......@@ -1795,6 +1795,9 @@ static int restore_root_task(struct pstree_item *init)
if (ret < 0)
goto out_kill;
if (fault_injected(FI_POST_RESTORE))
goto out_kill;
ret = run_scripts(ACT_POST_RESTORE);
if (ret != 0) {
pr_err("Aborting restore due to post-restore script ret code %d\n", ret);
......
......@@ -9,6 +9,7 @@ enum faults {
FI_DUMP_PAGES,
FI_RESTORE_OPEN_LINK_REMAP,
FI_PARASITE_CONNECT,
FI_POST_RESTORE,
/* not fatal */
FI_CHECK_OPEN_HANDLE = 128,
FI_NO_MEMFD = 129,
......
......@@ -13,4 +13,8 @@ prep
./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
./test/zdtm.py run -t zdtm/static/mntns_ghost --fault 6 --report report || fail
./test/zdtm.py run -t zdtm/static/mntns_link_remap --fault 6 --report report || fail
./test/zdtm.py run -t zdtm/static/unlink_fstat03 --fault 6 --report report || fail
./test/zdtm.py run -t zdtm/static/env00 --fault 5 --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