restore: Add restoration of the blocked threads signals from the image

To unify the code for both thread leader and regular threads
we move blocked signals for thread leader into threads argument
area and use restore_thread_common() helper.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Cyrill Gorcunov 2012-11-12 17:43:01 +04:00 committed by Pavel Emelyanov
parent 5da22b01fe
commit 2ee5a42f3e
3 changed files with 10 additions and 7 deletions

View file

@ -1481,7 +1481,8 @@ static int sigreturn_restore(pid_t pid, CoreEntry *core, struct list_head *tgt_v
task_args->t.clear_tid_addr = core->thread_info->clear_tid_addr;
task_args->ids = *core->ids;
task_args->t.gpregs = *core->thread_info->gpregs;
task_args->blk_sigset = core->tc->blk_sigset;
task_args->t.blk_sigset = core->tc->blk_sigset;
task_args->t.has_blk_sigset = true;
if (core->thread_core) {
task_args->t.has_futex = true;
@ -1558,6 +1559,8 @@ static int sigreturn_restore(pid_t pid, CoreEntry *core, struct list_head *tgt_v
thread_args[i].has_futex = true;
thread_args[i].futex_rla = core->thread_core->futex_rla;
thread_args[i].futex_rla_len = core->thread_core->futex_rla_len;
thread_args[i].has_blk_sigset = core->thread_core->has_blk_sigset;
thread_args[i].blk_sigset = core->thread_core->blk_sigset;
ret = prep_sched_info(&thread_args[i].sp, core->thread_core);
if (ret)

View file

@ -76,6 +76,9 @@ struct thread_restore_args {
u64 futex_rla;
u32 futex_rla_len;
bool has_blk_sigset;
u64 blk_sigset;
struct rst_sched_param sp;
struct task_restore_core_args *ta;
@ -112,7 +115,6 @@ struct task_restore_core_args {
MmEntry mm;
u64 mm_saved_auxv[AT_VECTOR_SIZE];
u32 mm_saved_auxv_size;
u64 blk_sigset;
char comm[TASK_COMM_LEN];
TaskKobjIdsEntry ids;

View file

@ -199,6 +199,9 @@ static int restore_thread_common(struct rt_sigframe *sigframe,
}
}
if (args->has_blk_sigset)
sigframe->uc.uc_sigmask.sig[0] = args->blk_sigset;
restore_sched_info(&args->sp);
return restore_gpregs(sigframe, &args->gpregs);
@ -497,11 +500,6 @@ long __export_restore_task(struct task_restore_core_args *args)
if (restore_thread_common(rt_sigframe, &args->t))
goto core_restore_end;
/*
* Blocked signals.
*/
rt_sigframe->uc.uc_sigmask.sig[0] = args->blk_sigset;
/*
* Threads restoration. This requires some more comments. This
* restorer routine and thread restorer routine has the following