Commit 1e9ccd2b authored by Pavel Emelyanov's avatar Pavel Emelyanov

dump: Don't kill tasks after failed dump

This is not very good practice :) Just leave them in the state they've been to before
dumping. Plz note, that tasks segfault for some reason after unseizeing, but this is
another story.
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 13ee53a0
...@@ -1076,16 +1076,13 @@ static void unseize_task_and_threads(const struct pstree_item *item, int st) ...@@ -1076,16 +1076,13 @@ static void unseize_task_and_threads(const struct pstree_item *item, int st)
unseize_task(item->threads[i], st); /* item->pid will be here */ unseize_task(item->threads[i], st); /* item->pid will be here */
} }
static void pstree_switch_state(const struct list_head *list, static void pstree_switch_state(const struct list_head *list, int st)
const struct cr_options *opts)
{ {
struct pstree_item *item; struct pstree_item *item;
list_for_each_entry(item, list, list) { pr_info("Unfreezing tasks into %d\n", st);
unseize_task_and_threads(item, opts->final_state); list_for_each_entry(item, list, list)
if (opts->leader_only) unseize_task_and_threads(item, st);
break;
}
} }
static int seize_threads(const struct pstree_item *item) static int seize_threads(const struct pstree_item *item)
...@@ -1691,7 +1688,8 @@ err: ...@@ -1691,7 +1688,8 @@ err:
xfree(shmems); xfree(shmems);
xfree(pipes); xfree(pipes);
close_cr_fdset(&glob_fdset); close_cr_fdset(&glob_fdset);
pstree_switch_state(&pstree_list, opts); pstree_switch_state(&pstree_list,
ret ? TASK_ALIVE : opts->final_state);
free_pstree(&pstree_list); free_pstree(&pstree_list);
return ret; return ret;
......
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
int unseize_task(pid_t pid, int st) int unseize_task(pid_t pid, int st)
{ {
pr_debug("\tUnseizeing %d into %d\n", pid, st);
if (st == TASK_DEAD) if (st == TASK_DEAD)
kill(pid, SIGKILL); kill(pid, SIGKILL);
else if (st == TASK_STOPPED) else if (st == TASK_STOPPED)
......
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