diff --git a/criu/cr-dump.c b/criu/cr-dump.c index ee5974acc..fe5e73798 100644 --- a/criu/cr-dump.c +++ b/criu/cr-dump.c @@ -157,6 +157,11 @@ static int dump_sched_info(int pid, ThreadCoreEntry *tc) tc->has_sched_policy = true; tc->sched_policy = ret; + /* The reset-on-fork flag might be used in combination + * with SCHED_FIFO or SCHED_RR to reset the scheduling + * policy/priority in child processes. + */ + ret &= ~SCHED_RESET_ON_FORK; if ((ret == SCHED_RR) || (ret == SCHED_FIFO)) { ret = syscall(__NR_sched_getparam, pid, &sp); if (ret < 0) { diff --git a/criu/cr-restore.c b/criu/cr-restore.c index 318d34c48..874986ca0 100644 --- a/criu/cr-restore.c +++ b/criu/cr-restore.c @@ -3057,7 +3057,7 @@ static int validate_sched_parm(struct rst_sched_param *sp) if ((sp->nice < -20) || (sp->nice > 19)) return 0; - switch (sp->policy) { + switch (sp->policy & ~SCHED_RESET_ON_FORK) { case SCHED_RR: case SCHED_FIFO: return ((sp->prio > 0) && (sp->prio < 100));