diff options
author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2007-10-04 22:06:00 -0400 |
---|---|---|
committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2007-10-04 22:06:00 -0400 |
commit | 89b511b0ba2440196cfaf35c70be3a87bac70783 (patch) | |
tree | ab840b350a576c45b6d5b66ca537e56c3448552c /kernel | |
parent | 5bf0318ae3aff339dfd177cc705ed38b3c5a389e (diff) | |
parent | 0ee9d55ca4d52506ce16ce51959eb59d0cb2d98f (diff) |
Import race fix.
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/litmus.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/kernel/litmus.c b/kernel/litmus.c index 1f7b6e28fd..266e6eea82 100644 --- a/kernel/litmus.c +++ b/kernel/litmus.c | |||
@@ -70,7 +70,9 @@ asmlinkage long sys_set_rt_mode(int newmode) | |||
70 | * EINVAL if either period or execution cost is <=0 | 70 | * EINVAL if either period or execution cost is <=0 |
71 | * 0 if success | 71 | * 0 if success |
72 | * | 72 | * |
73 | * FIXME: This code is racy during real-time mode. | 73 | * Only non-real-time tasks may be configured with this system call |
74 | * to avoid races with the scheduler. In practice, this means that a | ||
75 | * task's parameters must be set _before_ calling sys_prepare_rt_task() | ||
74 | */ | 76 | */ |
75 | asmlinkage long sys_set_rt_task_param(pid_t pid, rt_param_t __user * param) | 77 | asmlinkage long sys_set_rt_task_param(pid_t pid, rt_param_t __user * param) |
76 | { | 78 | { |
@@ -93,7 +95,16 @@ asmlinkage long sys_set_rt_task_param(pid_t pid, rt_param_t __user * param) | |||
93 | if (!(target = find_task_by_pid(pid))) { | 95 | if (!(target = find_task_by_pid(pid))) { |
94 | retval = -ESRCH; | 96 | retval = -ESRCH; |
95 | goto out_unlock; | 97 | goto out_unlock; |
98 | } | ||
99 | |||
100 | if (is_realtime(target)) { | ||
101 | /* The task is already a real-time task. | ||
102 | * We cannot not allow parameter changes at this point. | ||
103 | */ | ||
104 | retval = -EPERM; | ||
105 | goto out_unlock; | ||
96 | } | 106 | } |
107 | |||
97 | if (tp.exec_cost <= 0) | 108 | if (tp.exec_cost <= 0) |
98 | goto out_unlock; | 109 | goto out_unlock; |
99 | if (tp.period <= 0) | 110 | if (tp.period <= 0) |